HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.9/site-packages/pip/_internal/utils/__pycache__/compat.cpython-39.pyc
a

?�f%�@sdZddlmZmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZm
Z
ddlmZer�ddlmZmZmZmZmZmZmZed�ZGdd	�d	e�ZzddlZWnPe�yzdd
lmZWn*ey�ddlZeje_ej e_!Yn0Yn0gd�Z"e�#e$�Z%e�rTddl&Z&z
e&j'Z'Wne(�yHdZ'Yn0e'duZ)ndZ)dd
l*m'Z'e�r�dd�Z+e�,de+�dZ-ndZ-dd�Z.d(dd�Z/dd�Z0dd�Z1dd�Z2hd�Z3e
j4�5d��p�e
j4dk�o�ej6dkZ7d d!�Z8e9e	d"��r�d#d"�Z:nd$d"�Z:d)d%d&�Z;e<ed'e;�Z=dS)*zKStuff that differs in different Python versions and platform
distributions.�)�absolute_import�divisionN)�PY2�	text_type)�MYPY_CHECK_RUNNING)�Callable�Optional�Protocol�Text�Tuple�TypeVar�Union�Fc@seZdZddd�ZdS)�LruCacheNcCst�dS�N)�NotImplementedError)�self�maxsize�r�>/usr/lib/python3.9/site-packages/pip/_internal/utils/compat.py�__call__szLruCache.__call__)N)�__name__�
__module__�__qualname__rrrrrrsr)�	ipaddress)r�uses_pycache�console_to_str�get_path_uid�stdlib_pkgs�WINDOWS�samefile�get_terminal_sizeT)�cache_from_sourcecsB�fdd�t�j�j�D�}dd�|D�}d�tdj|���jfS)Nc3s|]}�j|VqdSr)�object)�.0�i��errrr�	<genexpr>I�z-backslashreplace_decode_fn.<locals>.<genexpr>css|]}t|�VqdSr)�ord)r$�brrrr(Kr)�z\x{:x})�range�start�end�join�map�format)r'Z	raw_bytesrr&r�backslashreplace_decode_fnHsr3�backslashreplace_decode�backslashreplacecCs2zddl}WdSty Yn0ddlm}|S)NrT)�IS_PYOPENSSL)�_ssl�ImportErrorZpip._vendor.urllib3.utilr6)r7r6rrr�has_tlsVsr9cCs�t|t�r|St��}|r*t�|�jdkr.d}z|�|�}Wn2tynt	�
d|pVd|�|j|td�}Yn0ttt
dd�dd�}|r�|j|d	d�}|�|�}|S)
a�
    For display or logging purposes, convert a bytes object (or text) to
    text (e.g. unicode in Python 2) safe for output.

    :param desc: An optional phrase describing the input data, for use in
        the log message if a warning is logged. Defaults to "Bytes object".

    This function should never error out and so can take a best effort
    approach. It is okay to be lossy if needed since the return value is
    just for display.

    We assume the data is in the locale preferred encoding. If it won't
    decode properly, we warn the user but decode as best we can.

    We also ensure that the output can be safely written to standard output
    without encoding errors.
    �asciizutf-8z&%s does not appear to be encoded as %szBytes object)�errors�
__stderr__N�encodingr5)�
isinstancer�locale�getpreferredencoding�codecs�lookup�name�decode�UnicodeDecodeError�loggerZwarningr4�getattr�sys�encode)�data�descr=Zdecoded_dataZoutput_encodingZoutput_encodedrrr�str_to_displaybs0
���
rLcCst|dd�S)z<Return a string, safe for output, of subprocess output.
    zSubprocess output)rK)rL)rJrrrr�srcCsbttd�r6t�|tjtjB�}t�|�j}t�|�n(tj�	|�sPt�
|�j}ntd�|���|S)a)
    Return path's uid.

    Does not follow symlinks:
        https://github.com/pypa/pip/pull/935#discussion_r5307003

    Placed this function in compat due to differences on AIX and
    Jython, that should eventually go away.

    :raises OSError: When path is a symlink or can't be read.
    �
O_NOFOLLOWz1{} is a symlink; Will not return uid for symlinks)
�hasattr�os�open�O_RDONLYrM�fstat�st_uid�close�path�islink�stat�OSErrorr2)rU�fdZfile_uidrrrr�s
��rcCs0tj�|�}|�d�r,|�d�r,|dd�}|S)zm
    Expand ~ and ~user constructions.

    Includes a workaround for https://bugs.python.org/issue14768
    z~/z//�N)rOrU�
expanduser�
startswith)rUZexpandedrrrr[�sr[>Zwsgiref�argparseZpython�winZcli�ntcCsNttjd�rtj�||�Stj�tj�|��}tj�tj�|��}||kSdS)z>Provide an alternative for os.path.samefile on Windows/Python2r N)rNrOrUr �normcase�abspath)Zfile1Zfile2Zpath1Zpath2rrrr �s
r r!cCstt���S)��
        Returns a tuple (x, y) representing the width(x) and the height(y)
        in characters of the terminal window.
        )�tuple�shutilr!rrrrr!�scCs�dd�}|d�p|d�p|d�}|sjtjdkrjz(t�t��tj�}||�}t�|�WntyhYn0|s�tj�	dd�tj�	d	d
�f}t
|d�t
|d�fS)rbcSsZz4ddl}ddl}ddl}|�d|�||jd��}WntyHYdS0|dkrVdS|S)NrZhhZ12345678)rr)�fcntl�termios�struct�unpack_fromZioctlZ
TIOCGWINSZ�	Exception)rYrerfrg�crrrr�ioctl_GWINSZ�s�z'get_terminal_size.<locals>.ioctl_GWINSZrrZ�Zwin32ZLINES�ZCOLUMNS�P)rH�platformrOrP�ctermidrQrTri�environ�get�int)rkrjrYrrrr!�s
cCsdd�}|S)NcSs|Srr)�frrr�_wrappersz noop_lru_cache.<locals>._wrapperr)rrurrr�noop_lru_cachesrv�	lru_cache)N)N)>�__doc__Z
__future__rrrA�	functoolsr?ZloggingrOrdrHZpip._vendor.sixrrZpip._internal.utils.typingr�typingrrr	r
rrr
rrrr8Zpip._vendorZipaddrZ	IPAddressZ
ip_addressZ	IPNetworkZ
ip_network�__all__Z	getLoggerrrFZimpr"�AttributeErrorr�importlib.utilr3�register_errorr4r9rLrrr[rror\rCrr rNr!rvrGrwrrrr�<module>sr$



�
C�
$