OwlCyberSecurity - MANAGER
Edit File: fix_urllib.cpython-311.opt-1.pyc
� �����/�g� �����������������������������d�Z�ddlmZmZ�ddlmZmZmZmZm Z m Z mZ�dg�d�fdg�d�fdd gfgdg�d �fdddgfgd �Zed���������� ��������������������ed���������d����������������������d��Z�G�d��de������������ZdS�)z�Fix changes imports of urllib which are now incompatible. This is rather similar to fix_imports, but because of the more complex nature of the fixing for urllib, it has its own fixer. �����)� alternates� FixImports)�Name�Comma� FromImport�Newline�find_indentation�Node�symszurllib.request) � URLopener�FancyURLopener�urlretrieve� _urlopener�urlopen� urlcleanup�pathname2url�url2pathname� getproxieszurllib.parse)�quote� quote_plus�unquote�unquote_plus� urlencode� splitattr� splithost� splitnport�splitpasswd� splitport� splitquery�splittag� splittype� splituser� splitvaluezurllib.error�ContentTooShortError)r����install_opener�build_opener�Request�OpenerDirector�BaseHandler�HTTPDefaultErrorHandler�HTTPRedirectHandler�HTTPCookieProcessor�ProxyHandler�HTTPPasswordMgr�HTTPPasswordMgrWithDefaultRealm�AbstractBasicAuthHandler�HTTPBasicAuthHandler�ProxyBasicAuthHandler�AbstractDigestAuthHandler�HTTPDigestAuthHandler�ProxyDigestAuthHandler�HTTPHandler�HTTPSHandler�FileHandler� FTPHandler�CacheFTPHandler�UnknownHandler�URLError� HTTPError)�urllib�urllib2r?���r>�������c������������ ���#�������K����t������������������������}�t���������������������������������������������D�]P\��}}|D�]H}|\��}}t����������|������������}d|�d|�d�V���d|�d|�d|�d�V���d|z��V���d |z��V���d |�d|�d�V����I�Qd�S�) Nzimport_name< 'import' (module=zB | dotted_as_names< any* module=z any* >) > zimport_from< 'from' mod_member=z* 'import' ( member=z | import_as_name< member=z] 'as' any > | import_as_names< members=any* >) > zIimport_from< 'from' module_star=%r 'import' star='*' > ztimport_name< 'import' dotted_as_name< module_as=%r 'as' any > > zpower< bare_with_attr=z trailer< '.' member=z > any* > )�set�MAPPING�itemsr���)�bare� old_module�changes�change� new_module�memberss��� �?/opt/alt/python311/lib64/python3.11/lib2to3/fixes/fix_urllib.py� build_patternrL���0���s����������5�5�D�&�}�}����.��.�� �G��� .�� .�F�"(��J�� ��)�)�G�G��$���Z�Z�Z�1�� 1�� 1�� 1�� 1��$���W�W�W�g�g�g�7�� 7�� 7�� 7��"�#�� #�� #�� #��"�#�� #�� #�� #�� #� �$���W�W�W�.�� .�� .�� .�� .�! .�.��.�����c��������������������,�����e�Zd�Zd��Zd��Zd��Zd��Zd��ZdS�)� FixUrllibc������������������D�����d����������������������t������������������������������������S�)N�|)�joinrL���)�selfs��� rK���rL���zFixUrllib.build_patternI���s�������x�x� ���(�(�(rM���c����������������������|����������������������d������������}|j��������}g�}t����������|j�����������������dd����������D�]:}|���������������������t����������|d���������|�������������t ������������������������g��������������;|���������������������t����������t����������|j�����������������d���������d���������|��������������������������|���������������������|�������������dS�)z�Transform for the basic import case. Replaces the old import name with a comma separated list of its replacements. �moduleN���r�����prefix) �getrX���rC����value�extendr���r����append�replace)rS����node�results� import_mod�pref�names�names��� rK����transform_importzFixUrllib.transform_importL���s������� ��[�[��*�*� �� ������J�,�-�c�r�c�2�� @�� @�D��L�L�$�t�A�w�t�4�4�4�e�g�g�>�?�?�?�?� ���T�'�*�"2�3�B�7��:�4�H�H�H�I�I�I����5�!�!�!�!�!rM���c�����������������������|����������������������d������������}|j��������}|����������������������d������������}|r�t����������|t����������������������r|d���������}d}t����������|j�����������������D�]}|j��������|d���������v�r |d���������}�n�|r&|���������������������t����������||��������������������������dS�|����������������������|d�������������dS�g�}i�} |d���������} | D�]�}|j ��������t����������j��������k����r%|j��������d ���������j��������}|j��������d���������j��������}n |j��������}d}|d k����rst����������|j�����������������D�]`}||d���������v�rT|d���������| vr|� ��������������������|d����������������������| ���������������������|d���������g�������������� ��������������������|��������������a��g�} t����������|������������}d}d��}|D�]�}| |���������}g�}|dd ����������D�]B}|����������������������|||�������������������������|� ��������������������t#��������������������������������������C|����������������������||d ���������|�������������������������t%����������||������������}|r|j��������j�����������������������������|������������r||_��������| � ��������������������|�������������d}��| rdg�}| dd ����������D�]%}|���������������������|t+������������������������g��������������&|� ��������������������| d ����������������������|���������������������|�������������dS�|����������������������|d�������������dS�)z�Transform for imports of specific module elements. Replaces the module to be imported from with the appropriate new module. � mod_member�memberr���Nr@���rW����!This is an invalid module elementrJ��������,Tc������������������L����|�j���������t����������j��������k����ryt����������|�j��������d���������j��������|�������������|�j��������d��������������������������������������������|�j��������d��������������������������������������������g}t����������t����������j��������|������������gS�t����������|�j��������|�������������gS�)Nr���rW���r@���ri���)�typer����import_as_namer����childrenrZ����cloner ���)rc���rX����kidss��� rK����handle_namez/FixUrllib.transform_member.<locals>.handle_name����s��������9�� 3�3�3� ���q�!1�!7��G�G�G� �M�!�,�2�2�4�4� �M�!�,�2�2�4�4�6�D��!��!4�d�;�;�<�<��T�Z��7�7�7�8�8rM���rV���FzAll module elements are invalid)rY���rX���� isinstance�listrC���rZ���r]���r����cannot_convertrl���r���rm���rn���r\���� setdefaultr ���r[���r���r����parent�endswithr���)rS���r^���r_���rf���ra���rg����new_namerH����modules�mod_dictrJ����as_name�member_name� new_nodes�indentation�firstrq���rU����eltsrb����elt�new�nodes�new_nodes��� rK����transform_memberzFixUrllib.transform_member\���s`����� ��[�[��.�.� �� �����X�&�&�����@ M��&�$�'�'�� #������H�!�*�"2�3�� �� ���<�6�!�9�,�,�%�a�y�H��E��-���� O��"�"�4���#>�#>�#>�?�?�?�?�?��#�#�D�*M�N�N�N�N�N� ��G��H��i�(�G�!�� N�� N���;�$�"5�5�5�$�o�a�0�6�G�"(�/�!�"4�":�K�K�"(�,�K�"�G��#�%�%�")�*�*:�";��N��N��&�&��)�3�3�%�a�y��8�8� '���v�a�y� 9� 9� 9�$�/�/��q� �2�>�>�E�E�f�M�M�M����I�*�4�0�0�K��E� 9�� 9�� 9��"�� �� ����'��������9��*��*�C��L�L���S�$�!7�!7�8�8�8��L�L����)�)�)�)����[�[��b��4�8�8�9�9�9� ���/�/����-��� 2� ;� ;�K� H� H��-�!,�C�J�� � ��%�%�%������ M��� )�#�2�#���8��8�H��L�L�(�G�I�I�!6�7�7�7�7����Y�r�]�+�+�+����U�#�#�#�#�#��#�#�D�*K�L�L�L�L�LrM���c������������������z����|����������������������d������������}|����������������������d������������}d}t����������|t����������������������r|d���������}t����������|j�����������������D�]}|j��������|d���������v�r |d���������}�n�|r+|���������������������t ����������||j����������������������������������dS�|����������������������|d�������������dS�)z.Transform for calls to module members in code.�bare_with_attrrg���Nr���r@���rW���rh���) rY���rr���rs���rC���rZ���r]���r���rX���rt���)rS���r^���r_���� module_dotrg���rx���rH���s��� rK���� transform_dotzFixUrllib.transform_dot����s��������[�[�!1�2�2� ����X�&�&�����f�d�#�#�� ��A�Y�F��j�.�/�� �� �F��|�v�a�y�(�(�!�!�9�����)���� K����t�H�+5�+<� >�� >�� >�� ?�� ?�� ?�� ?�� ?�� ����&I�J�J�J�J�JrM���c�����������������������|����������������������d������������r|����������������������||�������������d�S�|����������������������d������������r|����������������������||�������������d�S�|����������������������d������������r|����������������������||�������������d�S�|����������������������d������������r|����������������������|d�������������d�S�|����������������������d������������r|����������������������|d�������������d�S�d�S�)NrU���rf���r�����module_starzCannot handle star imports.� module_asz#This module is now multiple modules)rY���rd���r����r����rt���)rS���r^���r_���s��� rK���� transformzFixUrllib.transform����s������;�;�x� � �� M��!�!�$��0�0�0�0�0� �[�[�� &� &�� M��!�!�$��0�0�0�0�0� �[�[�)� *� *�� M����t�W�-�-�-�-�-� �[�[�� '� '�� M�����&C�D�D�D�D�D� �[�[�� %� %�� M�����&K�L�L�L�L�L� M�� MrM���N)�__name__� __module__�__qualname__rL���rd���r����r����r������rM���rK���rO���rO���G���sn��������������)��)��)�"��"��"� JM��JM��JM�XK��K��K�"M��M��M��M��MrM���rO���N)�__doc__�lib2to3.fixes.fix_importsr���r����lib2to3.fixer_utilr���r���r���r���r ���r ���r���rC���r\���rL���rO���r����rM���rK����<module>r�������s���������=��<��<��<��<��<��<��<�>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��"�C��C��C�D�� �?��?��?�@� � �+�,�.�/��"�'��'��'� (�� ���-�/� �����B�� �������'�(�+�A�.��/��/��/�.��.��.�.}M��}M��}M��}M��}M� ��}M��}M��}M��}M��}MrM���