1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
U
H=®d¡"ã @sîdZddlmZmZddlZddlZddlZddlZddlZddl    Z    ddl
m Z m Z ddl mZer|ddlmZmZmZmZz ddlZWnRek
rÚzddlmZWn,ek
rÔddlZeje_eje_YnXYnXdd    d
d d d ddgZe e¡Ze r8ddl Z z
e j!Z!Wne"k
r,dZ!YnXe!dk    Z#ndZ#ddl$m!Z!e rhdd„Z%e &de%¡dZ'ndZ'dd„Z(d'dd„Z)dd
„Z*dd „Z+dd„Z,ddd hZ-e    j. /d!¡pÂe    j.d"koÂej0d#kZ1d$d„Z2e3edƒrâd%d„Z4nd&d„Z4dS)(zKStuff that differs in different Python versions and platform
distributions.é)Úabsolute_importÚdivisionN)ÚPY2Ú    text_type)ÚMYPY_CHECK_RUNNING)ÚOptionalÚTextÚTupleÚUnion)Ú    ipaddressr Ú 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|VqdS©N)Úobject)Ú.0Úi©Úerr©úQD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\pip/_internal/utils/compat.pyÚ    <genexpr>@sz-backslashreplace_decode_fn.<locals>.<genexpr>css|]}t|ƒVqdSr)Úord)rÚbrrrrBsÚz\x{:x})ÚrangeÚstartÚendÚjoinÚmapÚformat)rZ    raw_bytesrrrÚbackslashreplace_decode_fn?sr&Úbackslashreplace_decodeÚbackslashreplacecCs4zddl}WdStk
r"YnXddlm}|S)NrT)Ú IS_PYOPENSSL)Ú_sslÚ ImportErrorÚpip._vendor.urllib3.utilr))r*r)rrrÚhas_tlsMs r-cCs¦t|tƒr|St ¡}|r*t |¡jdkr.d}z| |¡}Wn4tk
rpt     
d|pXd|¡|j|t d}YnXt 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Úencodingr()Ú
isinstancerÚlocaleÚgetpreferredencodingÚcodecsÚlookupÚnameÚdecodeÚUnicodeDecodeErrorÚloggerÚwarningr'ÚgetattrÚsysÚencode)ÚdataÚdescr1Ú decoded_dataÚoutput_encodingÚoutput_encodedrrrÚstr_to_displayYs2
ý ÿþ
rDcCs t|ddS)z<Return a string, safe for output, of subprocess output.
    zSubprocess output)r@)rD)r?rrrr œscCsbttdƒr6t |tjtjB¡}t |¡j}t |¡n(tj     |¡sPt 
|¡j}nt d  |¡ƒ‚|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_RDONLYrEÚfstatÚst_uidÚcloseÚpathÚislinkÚstatÚOSErrorr%)rMÚfdÚfile_uidrrrr£s
   ÿÿcCs0tj |¡}| d¡r,| d¡r,|dd…}|S)zm
    Expand ~ and ~user constructions.
 
    Includes a workaround for https://bugs.python.org/issue14768
    z~/z//éN)rGrMÚ
expanduserÚ
startswith)rMÚexpandedrrrrTÂs  rTÚpythonÚwsgirefÚargparseÚwinÚcliÚntcCsNttjdƒrtj ||¡Stj tj |¡¡}tj tj |¡¡}||kSdS)z>Provide an alternative for os.path.samefile on Windows/Python2rN)rFrGrMrÚnormcaseÚabspath)Úfile1Úfile2Úpath1Úpath2rrrrÜs
 cCs tt ¡ƒS)ú‚
        Returns a tuple (x, y) representing the width(x) and the height(y)
        in characters of the terminal window.
        )ÚtupleÚshutilrrrrrrèscCs¤dd„}|dƒp|dƒp|dƒ}|sltjdkrlz(t t ¡tj¡}||ƒ}t |¡Wntk
rjYnX|sŒtj     dd¡tj     d    d
¡f}t
|dƒt
|dƒfS) rccSs\z4ddl}ddl}ddl}| d| ||jd¡¡}Wntk
rJYdSX|dkrXdS|S)NrÚhhZ12345678)rr)ÚfcntlÚtermiosÚstructÚ unpack_fromÚioctlZ
TIOCGWINSZÚ    Exception)rQrgrhriÚcrrrrÚ ioctl_GWINSZösþz'get_terminal_size.<locals>.ioctl_GWINSZrrSéÚwin32ÚLINESéÚCOLUMNSéP) r=ÚplatformrGrHZctermidrIrLrlÚenvironÚgetÚint)rnrmrQrrrrðs
)N)5Ú__doc__Ú
__future__rrr5r3ÚloggingrGrer=Zpip._vendor.sixrrÚpip._internal.utils.typingrÚtypingrrr    r
r r+Ú pip._vendorÚipaddrZ    IPAddressÚ
ip_addressZ    IPNetworkÚ
ip_networkÚ__all__Ú    getLoggerÚ__name__r:ÚimprÚAttributeErrorr Úimportlib.utilr&Úregister_errorr'r-rDr rrTrrurUr7rrrFrrrrrÚ<module>sx  þ
 
 
 
 þ
C
ÿ