U n a" @sdZddlmZmZddlZddlZddlZddlZddlZddl Z ddl m Z m Z ddl mZer|ddlmZmZmZmZz ddlZWnRek rzddlmZWn,ek rddlZeje_eje_YnXYnXdd d d d d ddgZeeZe r8ddl Z z e j!Z!Wne"k r,dZ!YnXe!dk Z#ndZ#ddl$m!Z!e rhddZ%e&de%dZ'ndZ'ddZ(d'ddZ)dd Z*dd Z+ddZ,ddd hZ-e j./d!pe j.d"koej0d#kZ1d$dZ2e3edrd%dZ4nd&dZ4dS)(zKStuff that differs in different Python versions and platform distributions.)absolute_importdivisionN)PY2 text_type)MYPY_CHECK_RUNNING)OptionalTextTupleUnion) ipaddressr uses_pycacheconsole_to_str get_path_uid stdlib_pkgsWINDOWSsamefileget_terminal_sizeT)cache_from_sourcecsBfddtjjD}dd|D}dtdj|jfS)Nc3s|]}j|VqdSN)object).0ierr[C:\Users\vtejo\AppData\Local\Temp\pip-unpacked-wheel-6mt8ur68\pip\_internal\utils\compat.py @sz-backslashreplace_decode_fn..css|]}t|VqdSr)ord)rbrrrrBsz\x{:x})rangestartendjoinmapformat)rZ raw_bytesrrrbackslashreplace_decode_fn?sr&backslashreplace_decodebackslashreplacecCs4zddl}WdStk r"YnXddlm}|S)NrT) IS_PYOPENSSL)_ssl ImportErrorpip._vendor.urllib3.utilr))r*r)rrrhas_tlsMs r-cCst|tr|St}|r*t|jdkr.d}z||}WnDtk r|dkrXd}d |}t |||j|t d}YnXt t tdddd}|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-8Nz Bytes objectz&{} does not appear to be encoded as %s)errors __stderr__encodingr() isinstancerlocalegetpreferredencodingcodecslookupnamedecodeUnicodeDecodeErrorr%loggerwarningr'getattrsysencode)datadescr1 decoded_data msg_formatoutput_encodingoutput_encodedrrrstr_to_displayYs0     rEcCs t|ddS)zProvide an alternative for os.path.samefile on Windows/Python2rN)rGrHrNrnormcaseabspath)file1file2path1path2rrrrs  cCs ttS) Returns a tuple (x, y) representing the width(x) and the height(y) in characters of the terminal window. )tupleshutilrrrrrrscCsdd}|dp|dp|d}|sltjdkrlz(tttj}||}t|Wntk rjYnX|stj ddtj d d f}t |dt |dfS) rdcSs\z4ddl}ddl}ddl}|d|||jd}Wntk rJYdSX|dkrXdS|S)NrhhZ12345678)rr)fcntltermiosstruct unpack_fromioctlZ TIOCGWINSZ Exception)rRrhrirjcrrrr ioctl_GWINSZsz'get_terminal_size..ioctl_GWINSZrrTwin32LINESCOLUMNSP) r=platformrHrIZctermidrJrMrmenvirongetint)rornrRrrrrs )N)5__doc__ __future__rrr5r3loggingrHrfr=Zpip._vendor.sixrrpip._internal.utils.typingrtypingrrr r r r+ pip._vendoripaddrZ IPAddress ip_addressZ IPNetwork ip_network__all__ getLogger__name__r:imprAttributeErrorr importlib.utilr&register_errorr'r-rEr rrUrrvrVr7rrrGrrrrrsx        B