Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/future/utils/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/future/utils/__pycache__/surrogateescape.cpython-311.pyc

�

�܋f����dZddlZddlZddlmZdZd�Zd�Zejre	Z
d�ZneZ
e	Zd�Z
Gd	�d
e��Zd�Zd�Zd
�Zd�ZdZed��Zed��Zeje��jZd�ZedkrdSdS)z�
This is Victor Stinner's pure-Python implementation of PEP 383: the "surrogateescape" error
handler of Python 3.

Source: misc/python/surrogateescape.py in https://bitbucket.org/haypo/misc
�N)�utils�surrogateescapec�H�tjr|S|�d��S)N�unicode_escape)r�PY3�decode)�texts �m/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/future/utils/surrogateescape.py�urs$���y�-����{�{�+�,�,�,�c�H�tjr|�d��S|S)N�latin1)rr�encode)�datas r
�brs#���y���{�{�8�$�$�$��rc�"�t|f��S�N)�bytes)�codes r
�<lambda>r#s��U�D�7�^�^�rc��|j|j|j�}	t|t��rt|��}n't|t��rt|��}n|�n#t$r|�wxYw||jfS)z�
    Pure Python implementation of the PEP 383: the "surrogateescape" error
    handler of Python 3. Undecodable bytes will be replaced by a Unicode
    character U+DCxx on decoding, and these are translated into the
    original bytes on encoding.
    )	�object�start�end�
isinstance�UnicodeDecodeError�replace_surrogate_decode�UnicodeEncodeError�replace_surrogate_encode�NotASurrogateError)�exc�mystring�decodeds   r
�surrogateescape_handlerr$(s����z�#�)�C�G�+�,�H���c�-�.�.�	�.�x�8�8�G�G�
��/�
0�
0�	�/�x�8�8�G�G��I��������	������S�W��s�AA(�(
A5c��eZdZdS)r N)�__name__�
__module__�__qualname__�rr
r r Cs�������Drr c�l�g}|D]�}t|��}d|cxkrdks	nt�d|cxkrdkr)nn&|�t|dz
�����]|dkr&|�t|dz
������t�t	���|��S)z�
    Returns a (unicode) string, not the more logical bytes, because the codecs
    register_error functionality expects this.
    ������i�)�ordr �append�_unichr�str�join)r"r#�chrs    r
rrGs���
�G��%�%���2�w�w����'�'�'�'��'�'�'�'�$�$�
�T�#�#�#�#�V�#�#�#�#�#��N�N�7�4�&�=�1�1�2�2�2�2�
�V�^�^��N�N�7�4�&�=�1�1�2�2�2�2�$�$��5�5�:�:�g���rc�j�g}|D]�}t|t��r|}nt|��}d|cxkrdkr)nn&|�t	d|z�����_|dkr#|�t	|������t
�t
���|��S)z$
    Returns a (unicode) string
    ��r-�)r�intr.r/r0r r1r2)�mybytesr#r3rs    r
rrds����G��%�%���b�#���	��D�D��r�7�7�D��4�����4�������N�N�7�6�D�=�1�1�2�2�2�2�
�T�\�\��N�N�7�4�=�=�)�)�)�)�%�$��5�5�:�:�g���rc�v�tdkr�g}t|��D]}\}}t|��}|dkrt|��}n>d|cxkrdkrnnt|dz
��}nt	t|||dzd���|�|���~t
���|��Stdkr�g}t|��D]�\}}t|��}d	|cxkrd
krVnnSd|cxkrdkr+nn(t|dz
��}|�|���\t	t|||dzd���|�d��}|�|����t
���|��S|�tt��S)N�asciir5i��r,r-�zordinal not in range(128)zutf-8r+i��zsurrogates not allowed)
�FS_ENCODING�	enumerater.�	bytes_chrrr/rr2r�	FS_ERRORS)�fn�encoded�indexr3r�ch_utf8s      r
�encodefilenamerE}s����g�����"�2���
	�
	�I�E�2��r�7�7�D��c�z�z��t�_�_����4�)�)�)�)�6�)�)�)�)�)��t�f�}�-�-���(����u�Q�w�/�1�1�1�
�N�N�2������w�w�|�|�G�$�$�$�	��	�	���"�2���	(�	(�I�E�2��r�7�7�D���'�'�'�'��'�'�'�'�'��T�+�+�+�+�V�+�+�+�+�+�"�4�&�=�1�1�B��N�N�2�&�&�&�&�,�#��E�5��7�,D�F�F�F��)�)�G�,�,�����w�'�'�'�'��w�w�|�|�G�$�$�$��y�y��i�0�0�0rc�B�|�tt��Sr)rr=r@)rAs r
�decodefilenamerG�s��
�9�9�[�)�,�,�,rr;u[abcÿ]u[abc�]c��tjrdS	tjt��dS#t
$r#tjtt��YdSwxYw)zH
    Registers the surrogateescape error handler on Python 2 (only)
    N)rr�codecs�lookup_errorr@�LookupError�register_errorr$r)rr
�register_surrogateescaperM�sl��
�y����B���I�&�&�&�&�&���B�B�B���i�)@�A�A�A�A�A�A�B���s�+�)A�A�__main__)�__doc__rI�sys�futurerr@rrr�chrr0r?�unichrr$�	Exceptionr rrrErGr=rArB�lookup�namerMr&r)rr
�<module>rWsX�����
�
�
�
�
�
�
�������
�	�
-�-�-����	�9���G�+�+�I�I��G��I����6	�	�	�	�	��	�	�	����:���2%1�%1�%1�N-�-�-���A�A�k�N�N�r�a�a�
�6F�6F�G��f�m�K�(�(�-��	B�	B�	B��z����D��r

Hacked By AnonymousFox1.0, Coded By AnonymousFox