| Server IP : 93.86.61.54 / Your IP : 216.73.216.156 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/future/utils/__pycache__/ |
Upload File : |
o
,�]� � @ s� d Z ddlZddlZddlmZ dZdd� Zdd� Zejr$e Z
d d
� ZneZ
e Zdd� Z
G d
d� de�Zdd� Zdd� Zdd� Zdd� ZdZed�Zed�Ze�e�jZdd� Zedkr_ dS dS )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 C s t jr| S | �d�S )N�unicode_escape)r �PY3�decode)�text� r �>/usr/lib/python3/dist-packages/future/utils/surrogateescape.py�u s
r
c C s t jr| �d�S | S )N�latin1)r r �encode)�datar r r �b s
r c C s
t | f�S �N)�bytes)�coder r r �<lambda># s
r c C s` | j | j| j� }zt| t�rt|�}nt| t�rt|�}n| �W n ty* | �w || 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�decodedr r r �surrogateescape_handler( s
��
r c @ s e Zd ZdS )r N)�__name__�
__module__�__qualname__r r r r r C s r c C s� g }| D ]9}t |�}d| krdkst� t�d| kr"dkr.n n
|�t|d �� q|dkr<|�t|d �� qt�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 �chr r r r r G s �r c C sx g }| D ]1}t |t�r|}nt|�}d| krdkr(n n
|�td| �� q|dkr4|�t|�� qt�t� �|�S )z$
Returns a (unicode) string
� � r% � )r �intr&