Mini Kabibi Habibi

Current Path : C:/Users/ITO/AppData/Local/Programs/Python/Python314/Lib/urllib/__pycache__/
Upload File :
Current File : C:/Users/ITO/AppData/Local/Programs/Python/Python314/Lib/urllib/__pycache__/request.cpython-314.pyc

+
��h�3���Rt^RIt^RIt^RIt^RIt^RIt^RIt^RIt^RI	t	^RI
t
^RIt^RIt^RI
t
^RIt^RIt^RIHtHtHt^RIHtHtHtHtHtHtHtHtHtHtHtH t H!t!H"t"H#t#H$t$^RI%H&t&H't'^RI(t(Rt).RNRNR	NR
NRNRNR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%Nt+R&]
PXR',,t-Rs.R]P^3R(R/R)llt0R*t1.t2RjR+lt3R,t4]
Pj!R-]
Pl4t7R.t8!R/R4t9!R0R4t:R1t;!R2R	4t<!R3R]<4t=!R4R
]<4t>!R5R]<4t?R6t@!R7R
]<4tA!R8R4tB!R9R]B4tC!R:R]C4tD!R;R4tE!R<R]E]<4tF!R=R]E]<4tG]	P�tI!R>R4tJ!R?R]<]J4tK!R@R]<]J4tL!RARB]<4tM!RCR]M4tN]O!]P�RD4'd!RERF]M4tQ]+P�RF4!RGR]<4tS!RHR]<4tTRItURJtV!RKR]<4tWRLtX!RMR]<4tY!RNR]Y4tZ!ROR]<4t[RPRRQR/RRlt\RSR/RTlt]Rs^RUt_Rs`RVtaRsbRWtcRsdRXte!RYRZ4tfR[tgRkR\lthR]tiR^tj]
P�R_8Xd^R`IlHmtmHntnRatoRbtpRctqRdtrR#]	P�Re8XdRfttRgtrRhtuRitqR#]gtr]htqR# ]*dRt)EL�i;i)la�
An extensible library for opening URLs using a variety of protocols

The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below).  It opens the URL and returns the results as file-like
object; the returned object has some extra methods described below.

The OpenerDirector manages a collection of Handler objects that do
all the actual work.  Each Handler implements a particular protocol or
option.  The OpenerDirector is a composite object that invokes the
Handlers needed to open the requested URL.  For example, the
HTTPHandler performs HTTP GET and POST requests and deals with
non-error returns.  The HTTPRedirectHandler automatically deals with
HTTP 301, 302, 303, 307, and 308 redirect errors, and the
HTTPDigestAuthHandler deals with digest authentication.

urlopen(url, data=None) -- Basic usage is the same as original
urllib.  pass the url and optionally data to post to an HTTP URL, and
get a file-like object back.  One difference is that you can also pass
a Request instance instead of URL.  Raises a URLError (subclass of
OSError); for HTTP errors, raises an HTTPError, which can also be
treated as a valid response.

build_opener -- Function that creates a new OpenerDirector instance.
Will install the default handlers.  Accepts one or more Handlers as
arguments, either instances or Handler classes that it will
instantiate.  If one of the argument is a subclass of the default
handler, the argument will be installed instead of the default.

install_opener -- Installs a new opener as the default opener.

objects of interest:

OpenerDirector -- Sets up the User Agent as the Python-urllib client and manages
the Handler classes, while dealing with requests and responses.

Request -- An object that encapsulates the state of a request.  The
state can be as simple as the URL.  It can also include extra HTTP
headers, e.g. a User-Agent.

BaseHandler --

internals:
BaseHandler and parent
_call_chain conventions

Example usage:

import urllib.request

# set up authentication info
authinfo = urllib.request.HTTPBasicAuthHandler()
authinfo.add_password(realm='PDQ Application',
                      uri='https://mahler:8092/site-updates.py',
                      user='klem',
                      passwd='geheim$parole')

proxy_support = urllib.request.ProxyHandler({"http" : "http://ahad-haam:3128"})

# build a new opener that adds authentication and caching FTP handlers
opener = urllib.request.build_opener(proxy_support, authinfo,
                                     urllib.request.CacheFTPHandler)

# install it
urllib.request.install_opener(opener)

f = urllib.request.urlopen('https://www.python.org/')
N)�URLError�	HTTPError�ContentTooShortError)�urlparse�urlsplit�urljoin�unwrap�quote�unquote�
_splittype�
_splithost�
_splitport�
_splituser�_splitpasswd�
_splitattr�_splitvalue�	_splittag�unquote_to_bytes�
urlunparse)�
addinfourl�addclosehookTF�Request�OpenerDirector�BaseHandler�HTTPDefaultErrorHandler�HTTPRedirectHandler�HTTPCookieProcessor�ProxyHandler�HTTPPasswordMgr�HTTPPasswordMgrWithDefaultRealm�HTTPPasswordMgrWithPriorAuth�AbstractBasicAuthHandler�HTTPBasicAuthHandler�ProxyBasicAuthHandler�AbstractDigestAuthHandler�HTTPDigestAuthHandler�ProxyDigestAuthHandler�HTTPHandler�FileHandler�
FTPHandler�CacheFTPHandler�DataHandler�UnknownHandler�HTTPErrorProcessor�urlopen�install_opener�build_opener�pathname2url�url2pathname�
getproxies�urlretrieve�
urlcleanupz%d.%d:N�N�contextc��V'd\VR7p\V4pM\f\4;spM\pVPWV4#)a�Open the URL url, which can be either a string or a Request object.

*data* must be an object specifying additional data to be sent to
the server, or None if no such data is needed.  See Request for
details.

urllib.request module uses HTTP/1.1 and includes a "Connection:close"
header in its HTTP requests.

The optional *timeout* parameter specifies a timeout in seconds for
blocking operations like the connection attempt (if not specified, the
global default timeout setting will be used). This only works for HTTP,
HTTPS and FTP connections.

If *context* is specified, it must be a ssl.SSLContext instance describing
the various SSL options. See HTTPSConnection for more details.


This function always returns an object which can work as a
context manager and has the properties url, headers, and status.
See urllib.response.addinfourl for more detail on these properties.

For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
object slightly modified. In addition to the three new methods above, the
msg attribute contains the same information as the reason attribute ---
the reason phrase returned by the server --- instead of the response
headers as it is specified in the documentation for HTTPResponse.

For FTP, file, and data URLs, this function returns a
urllib.response.addinfourl object.

Note that None may be returned if no handler handles the request (though
the default installed global OpenerDirector uses UnknownHandler to ensure
this never happens).

In addition, if proxy settings are detected (for example, when a *_proxy
environment variable like http_proxy is set), ProxyHandler is default
installed and makes sure the requests are handled through the proxy.

�r7)�HTTPSHandlerr0�_opener�open)�url�data�timeoutr7�
https_handler�openers&&&$  �JC:\Users\ITO\AppData\Local\Programs\Python\Python314\Lib\urllib\request.pyr.r.�sC��V�$�W�5�
��m�,��	��'�>�)��&����;�;�s�'�*�*�c�
�VsR#�N)r;)rAs&rBr/r/�s���GrCc	��\V4wrE\P!\W44;_uu_4pVP	4pVR8Xd4V'g,\
PPV4V3uuRRR4#V'd\VR4pM8\P!RR7pVPp\PV4T;_uu_4W3p	R	p
R
p^p^p
RV9d\VR,4pV'd
V!W�V4VPV
4;p'dBV\!V4,
pVP#V4V
^,
p
V'gKOV!W�V4KZRRR4RRR4X^8�dXV8d\%RW�3,X	4hX	# +'giL<;i +'giLG;i)a+
Retrieve a URL into a temporary location on disk.

Requires a URL argument. If a filename is passed, it is used as
the temporary file location. The reporthook argument should be
a callable that accepts a block number, a read size, and the
total file size of the URL target. The data argument should be
valid URL encoded data.

If a filename is passed and the URL points to a local resource,
the result is a copy from local file to new file.

Returns a tuple containing the path to the newly created
data file as well as the resulting HTTPMessage object.
�fileN�wbF)�delete�content-lengthzContent-Lengthz1retrieval incomplete: got only %i out of %i bytesi ���)r�
contextlib�closingr.�info�os�path�normpathr<�tempfile�NamedTemporaryFile�name�_url_tempfiles�append�int�read�len�writer)r=�filename�
reporthookr>�url_typerP�fp�headers�tfp�result�bs�sizerX�blocknum�blocks&&&&           rBr4r4�st��  ��_�N�H�	�	�	�G�C�.�	/�	/�2��'�'�)���v��h��7�7�#�#�D�)�7�2�

0�	/���x��&�C��-�-�U�;�C��x�x�H��!�!�(�+�
�S��&�F��B��D��D��H��7�*��7�#3�4�5����8��.��7�7�2�;�&�%�&���E�
�"���	�	�%� ��A�
���:��x�T�2�'��!
0�F�q�y�T�D�[�"�?��l�
�"�$�	$��M�1�S��!
0�	/�sH�F/� F/�F/�AF/�,F	�!F	�&1F	�F	�(F/�F,
�'F/�/F?	c��\Fp\P!V4K	\R\'dRsR#R# \dKEi;i)z0Clean up temporary files from urlretrieve calls.:NNNN)rUrO�unlink�OSErrorr;)�	temp_files rBr5r5�sJ��#�	�	��I�I�i� �$�	�q���w������	��	�s�>�A
�A
z:\d+$c��VPp\V4^,pVR8XdVPRR4p\P	RV^4pVP4#)z|Return request-host, as defined by RFC 2965.

Variation from RFC: returned value is lowercased, for convenient
comparison.

��Host)�full_urlr�
get_header�_cut_port_re�sub�lower)�requestr=�hosts&  rB�request_hostrt
sX���
�
�C��C�=���D��r�z��!�!�&�"�-�����B��a�(�D��:�:�<�rCc�*a�]tRtRtoR/RRR3Rlt]R4t]PR4t]PR4t]R4t	]	PR	4t	]	PR
4t	Rt
RtR
tRt
RtRtRtRtRRltRtRtRtVtR#)riNFc��Wn/Vn/VnRVnW nRVnVP
4FwrxVPWx4K	Vf\V4pW@n	WPn
V'd	W`nR#R#rE)rmr_�unredirected_hdrs�_datar>�_tunnel_host�items�
add_headerrt�origin_req_host�unverifiable�method)	�selfr=r>r_r|r}r~�key�values	&&&&&&&  rB�__init__�Request.__init__ss���
����!#�����
��	� ���!�-�-�/�J�C��O�O�C�'�*��"�*�4�0�O�.��(��� �K�rCc��VP'd'RPVPVP4#VP#)z{}#{})�fragment�format�	_full_url�rs&rBrm�Request.full_url1s.���=�=�=��>�>�$�.�.�$�-�-�@�@��~�~�rCc��\V4Vn\VP4wVnVnVP	4R#rE)rr�rr��_parse)rr=s&&rBrmr�7s/�� �����(1�$�.�.�(A�%����
����
rCc�0�RVnRVnRVnR#)Nrk)r�r��selectorr�s&rBrmr�>s�������
���
rCc��VP#rE)rxr�s&rBr>�Request.dataDs���z�z�rCc��WP8wd3WnVPR4'dVPR4R#R#R#)�Content-lengthN)rx�
has_header�
remove_header)rr>s&&rBr>r�Hs<���:�:���J����/�0�0��"�"�#3�4�1�rCc��RVnR#rE)r>r�s&rBr>r�Rs	����	rCc� �\VP4wVnpVPf\RVP,4h\V4wVnVnVP'd\VP4VnR#R#)Nzunknown url type: %r)	rr��type�
ValueErrorrmrrsr�r
)r�rests& rBr��Request._parseVsf��$�T�^�^�4���	�4��9�9���3�d�m�m�C�D�D�#-�d�#3� ��	�4�=��9�9�9���	�	�*�D�I�rCc�@�VPeRMRp\VRV4#)z3Return a string indicating the HTTP request method.�POST�GETr~)r>�getattr)r�default_methods& rB�
get_method�Request.get_method^s!��#'�9�9�#8��e���t�X�~�6�6rCc��VP#rE)rmr�s&rB�get_full_url�Request.get_full_urlcs���}�}�rCc��VPR8Xd%VP'gVPVnMW nVPVnWnR#)�httpsN)r�ryrsrmr�)rrsr�s&&&rB�	set_proxy�Request.set_proxyfs:���9�9����(9�(9�(9� $�	�	�D���I� �M�M�D�M��	rCc�4�VPVP8H#rE)r�rmr�s&rB�	has_proxy�Request.has_proxyns���}�}��
�
�-�-rCc�>�W PVP4&R#rE)r_�
capitalize�rr��vals&&&rBr{�Request.add_headerqs��),���S�^�^�%�&rCc�>�W PVP4&R#rE)rwr�r�s&&&rB�add_unredirected_header�Request.add_unredirected_headerus��36���s�~�~�/�0rCc�J�WP9;'gWP9#rE)r_rw�r�header_names&&rBr��Request.has_headerys'���|�|�+�6�6��5�5�5�	7rCc�l�VPPVVPPW44#rE)r_�getrw)rr��defaults&&&rBrn�Request.get_header}s0���|�|�����"�"�&�&�{�<�>�	>rCc�v�VPPVR4VPPVR4R#rE)r_�poprwr�s&&rBr��Request.remove_header�s,��������d�+����"�"�;��5rCc�h�/VPCVPCp\VP44#rE)rwr_�listrz)r�hdrss& rB�header_items�Request.header_items�s,��9�$�(�(�9�D�L�L�9���D�J�J�L�!�!rC)rxr�ryr>r�rmr_rsr~r|r�r�rwr}rE)�__name__�
__module__�__qualname__�__firstlineno__r��propertyrm�setter�deleterr>r�r�r�r�r�r{r�r�rnr�r��__static_attributes__�__classdictcell__��
__classdict__s@rBrrs�����!%�r�!%�E��!�$����
�_�_����������
����
�[�[�5��5�
�\�\����+�7�
��.�-�7�7�>�
6�"�"rCc�ja�]tRtRtoRtRtRtRtR]P3Rlt
RRltR	tR
t
VtR#)ri�c�z�R\,pRV3.Vn.Vn/Vn/Vn/Vn/VnR#)zPython-urllib/%sz
User-agentN)�__version__�
addheaders�handlers�handle_open�handle_error�process_response�process_request)r�client_versions& rBr��OpenerDirector.__init__�sB��+�k�9��(�.�9�:�����
������� "���!��rCc�|�\VR4'g\R\V4,4hRp\V4EF.pVR
9dK
VP	R4pVRVpW4^,RpVPR4'dbVP	R4V,^,pW7^,Rp\
V4pVPPV/4p	W�PV&MDVR8XdTpVPp	M.VR8XdTpVPp	MVR8XdTpVPp	MK�V	PV.4p
V
'd\P!W�4MV
P!V4R	pEK1	V'd5\P!VP"V4VP%V4R#R# \dELi;i)�
add_parentz%expected BaseHandler instance, got %rF�_N�errorr<�responserrT)�redirect_request�do_open�
proxy_open)�hasattr�	TypeErrorr��dir�find�
startswithrWr�r�r�r�r�r��
setdefault�bisect�insortrVr�r�)r�handler�added�meth�i�protocol�	condition�j�kind�lookupr�s&&         rB�add_handler�OpenerDirector.add_handler�s����w��-�-��C� ��M�*�+�
+�����L�D��D�D���	�	�#��A��B�Q�x�H��q�S�T�
�I��#�#�G�,�,��N�N�3�'�!�+�a�/���a�C�D�z����t�9�D��*�*�.�.�x��<��.4�!�!�(�+��f�$����)�)���j�(����.�.���i�'����-�-����(�(��r�2�H���
�
�h�0�����(��E�G!�J��M�M�$�-�-��1����t�$���/"����s�+F,�,F;�:F;c��R#rE�r�s&rB�close�OpenerDirector.close����rCc�n�VPVR4pVFp\Wc4pV!V!pVfKVu#	R#)Nr�)r�r�)	r�chainr��	meth_name�argsr�r��funcras	&&&&*    rB�_call_chain�OpenerDirector._call_chain�s<���9�9�T�2�&���G��7�.�D��4�[�F��!��
�	 rCNc�0�\V\4'd
\W4pMTpVeW$nW4nVP
pVR,pVPPV.4Fp\Wv4pV!V4pK	\P!RVPVPVPVP44VPWB4p	VR,pVPPV.4Fp\Wv4pV!WI4p	K	V	#)N�_requestzurllib.Request�	_response)�
isinstance�strrr>r?r�r�r�r��sys�auditrmr_r��_openr�)
r�fullurlr>r?�reqr�r��	processorr�r�s
&&&&      rBr<�OpenerDirector.open�s����g�s�#�#��'�(�C��C��������8�8���Z�'�	��-�-�1�1�(�B�?�I��9�0�D��s�)�C�@�	�	�	�"�C�L�L�#�(�(�C�K�K����IY�Z��:�:�c�(���[�(�	��.�.�2�2�8�R�@�I��9�0�D��C�*�H�A��rCc��VPVPRRV4pV'dV#VPpVPVPWDR,V4pV'dV#VPVPRRV4#)r��default_openr�unknown�unknown_open)r�r�r�)rr	r>rar�s&&&  rBr�OpenerDirector._open�s����!�!�$�"2�"2�I�"0�#�7����M��8�8���!�!�$�"2�"2�H�")�?*�+.�0����M����� 0� 0�)� .��5�	5rCc�(�VR9d+VPR,pV^,pRV,p^pTpMVPpVR,p^pW1V3V,pVP!V!pV'dV#V'dVRR3X,pVP!V!#R#)�httpz
http_error_%s�_errorr��http_error_defaultN)rr�)r�r�)r�protor��dictr��http_err�	orig_argsras&&*     rBr��OpenerDirector.errors����%�%��$�$�V�,�D���G�E�'�%�/�I��H��I��$�$�D���(�I��H��Y�'�$�.���!�!�4�(����M���)�%9�:�Y�F�D��#�#�T�*�*�rC)r�r�r�r�r�r�rE)r�r�r�r�r�r�r�r��socket�_GLOBAL_DEFAULT_TIMEOUTr<rr�r�r�r�s@rBrr�s;����	"�-%�^
�	�"&�v�/M�/M��:
5�+�+rCc	��\4p\\\\\
\\\\.	p\\PR4'dVP\4\4pVFlpVFcp\!V\"4'd'\%WT4'dVP'V4K=K?\!WT4'gKRVP'V4Ke	Kn	VFpVP)V4K	VFpVP+V!44K	VF1p\!V\"4'dV!4pVP+V4K3	V#)aCreate an opener object from a list of handlers.

The opener will use several default handlers, including support
for HTTP, FTP and when applicable HTTPS.

If any of the handlers passed as arguments are subclasses of the
default handlers, the default handlers will not be used.
�HTTPSConnection)rrr,r'rrr)r(r-r+r�r�clientrVr:�setrr��
issubclass�add�remover�)r�rA�default_classes�skip�klass�check�hs*      rBr0r0s���
�F�#�^�[�.�0C�!�;�0B�"�$�O��t�{�{�-�.�.����|�,��5�D� ���E��%��&�&��e�+�+��H�H�U�O�,��E�)�)�������!������u�%��!�����5�7�#�!����a������A����1����MrCc�6a�]tRtRtoRtRtRtRtRtVt	R#)ri=i�c��WnR#rE��parent)rr+s&&rBr��BaseHandler.add_parent@s���rCc��R#rEr�r�s&rBr��BaseHandler.closeCr�rCc�\�\VR4'gR#VPVP8#)�
handler_orderT)r�r0)r�others&&rB�__lt__�BaseHandler.__lt__Gs+���u�o�.�.���!�!�E�$7�$7�7�7rCr*N)
r�r�r�r�r0r�r�r2r�r�r�s@rBrr=s�����M��
�8�8rCc�2a�]tRtRtoRtRtRt]tRtVt	R#)r-iPzProcess HTTP error responses.i�c��VPVPVP4rTp^�Tu;8:dR8g!MVPP	RWW4V4pV#)���,r)�code�msgrNr+r�)rrrr�r8r9r�s&&&   rB�
http_response� HTTPErrorProcessor.http_responseTsN��"�-�-����x�}�}��4���t�!�c�!��{�{�(�(���4�d�<�H��rCr�N)
r�r�r�r��__doc__r0r:�https_responser�r�r�s@rBr-r-Ps����'��M�	�#�NrCc�&a�]tRtRtoRtRtVtR#)riac�0�\VPW4WR4hrE)rrm)rr	r^r8r9r�s&&&&&&rBr�*HTTPDefaultErrorHandler.http_error_defaultbs������d��:�:rCr�N)r�r�r�r�rr�r�r�s@rBrras����;�;rCc�Ha�]tRtRto^t^
tRtRt];t;t	;t
tRtRt
VtR#)riec��VP4pVR9dVR	9g&VR
9dVR8Xg\VPW4WR4hVPRR4pRpVPP4U	U
u/uFwr�V	P
4V9gKW�bK 	pp	p
\TVR8XdRMRVVPRR7#uup
p	i)auReturn a Request or None in response to a redirect.

This is called by the http_error_30x methods when a
redirection response is received.  If a redirection should
take place, return a new Request to allow http_error_30x to
perform the redirect.  Otherwise, raise HTTPError if no-one
else should try to handle this url.  Return None if you can't
but another Handler might.
r��HEADr�� z%20T)r~r_r|r})�-�.�/i3i4)r�rC)rErFrG)rJzcontent-type)	r�rrm�replacer_rzrqrr|)rr	r^r8r9r_�newurl�m�CONTENT_HEADERS�k�v�
newheaderss&&&&&&&     rBr��$HTTPRedirectHandler.redirect_requestms���
�N�N����2�2�q�O�7K���&�1��;��C�L�L�$�W�A�A�����U�+��<��'*�{�{�'8�'8�':�;�':�t�q�����/�9��a�d�':�
�;��v�()�V��f��)�'*�':�':�$(�	*�	*��;s�5B?�B?c��RV9dVR,pMRV9dVR,pMR#\V4pVPR
9d\WcV:RV:R2WR4hVP'g#VP'd\V4pRV^&\
V4p\VR\PR7p\VPV4pVPWW4WV4pVfR#\VR4'dxVP;q�nV	PV^4VP 8�g\#V	4VP$8�d*\VPVVP&V,WR4hM/;p	;VnVnV	PV^4^,W�&VP)4VP+4VP,P/W�P0R	7#)�location�uriNz - Redirection to url 'z' is not allowed�/z
iso-8859-1)�encoding�safe�
redirect_dict�r?)rr��ftprk)r�schemerrP�netlocr�rr	�string�punctuationrrmr�r�rVr��max_repeatsrY�max_redirections�inf_msgrXr�r+r<r?)
rr	r^r8r9r_rI�urlparts�new�visiteds
&&&&&&    rB�http_error_302�"HTTPRedirectHandler.http_error_302�s����� ��Z�(�F�
�g�
��U�^�F���F�#��
�?�?�">�>���AD�f�M���
�
�}�}�}������H�~�H��H�Q�K��H�%��
��\��0B�0B�D������v�.��
�#�#�C�T��H���;���3��(�(�*-�*;�*;�;�G�'����F�A�&�$�*:�*:�:��G��� 5� 5�5�����d� $���s� 2�G�A�A�6�?A�@�G�@�c�'�#�*;�!�+�+�f�a�0�1�4���	���	�
���
��{�{����[�[��9�9rCzoThe HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
r�N)r�r�r�r�r]r^r�rc�http_error_301�http_error_303�http_error_307�http_error_308r_r�r�r�s@rBrres?�����K���!*�N::�xIW�V�N�V�^�V�n�~�2�GrCc��\V4wrVPR4'gRpTpMtVPR4'g\RV,4hRV9d%VPR4pVPRV4pMVPR^4pVR8XdRpV^Vp\	V4wrgVe\V4wr�MR;r�WW�3#)z�Return (scheme, user, password, host/port) given a URL or an authority.

If a URL is supplied, it must have an authority (host:port) component.
According to RFC 3986, having an authority component means the URL must
have two slashes after the scheme.
rSN�//zproxy URL with no authority: %r�@rK)rr�r�r�rr)
�proxyrY�r_scheme�	authority�host_separator�end�userinfo�hostport�user�passwords
&         rB�_parse_proxyru�s���"�%�(��F����s�#�#����	��"�"�4�(�(��>��F�G�G��(�?�%�]�]�3�/�N��-�-��^�4�C��-�-��Q�'�C��"�9��C��Q�s�O�	�#�I�.��H���%�h�/���h������+�+rCc�4a�]tRtRto^dtRRltRtRtVtR#)ri�Nc��Vf\4p\VR4'gQR4hWnVP4F8wr#VP	4p\VRV,W2VP3Rl4K:	R#)N�keyszproxies must be a mappingz%s_openc��V!WV4#rEr�)�rrlr�r�s&&&&rB�<lambda>�'ProxyHandler.__init__.<locals>.<lambda>s���Q�t�,rC)r3r��proxiesrzrq�setattrr�)rr}r�r=s&&  rBr��ProxyHandler.__init__�sh���?� �l�G��w��'�'�D�)D�D�'��� ����I�D��:�:�<�D��D�)�d�*�$'����-�
.�)rCc�0�VPp\V4wrVrxVfTpVP'd\VP4'dR#V'dpV'dh\	V4:R\	V4:2p	\
P!V	P44PR4p
VPRRV
,4\	V4pVPW�4WE8XgVR8XdR#VPPWPR7#)N�:�ascii�Proxy-authorization�Basic r�rW)r�rurs�proxy_bypassr
�base64�	b64encode�encode�decoder{r�r+r<r?)rr	rlr��	orig_type�
proxy_typersrtrr�	user_pass�credss&&&&       rBr��ProxyHandler.proxy_opens����H�H�	�/;�E�/B�,�
�(���"�J��8�8�8��S�X�X�.�.���H�#*�4�=�#*�8�#4�6�I��$�$�Y�%5�%5�%7�8�?�?��H�E��N�N�0�(�U�2B�C��8�$���
�
�h�+��"�i�7�&:���;�;�#�#�C���#�=�=rC)r}rE)	r�r�r�r�r0r�r�r�r�r�s@rBrr�s�����M�	.�>�>rCc�Ba�]tRtRtoRtRtRtR	RltRtRt	Vt
R#)
ri#c��/VnR#rE��passwdr�s&rBr��HTTPPasswordMgr.__init__%s	����rCc�$aa�\V\4'dV.pVSP9d/SPV&RFNo\;QJd.VV3RlV4FNK	5M!VV3RlV44pW43SPV,V&KP	R#)Tc3�H<"�TFpSPVS4x�K	R#5irE)�
reduce_uri)�.0�u�default_portrs& ��rB�	<genexpr>�/HTTPPasswordMgr.add_password.<locals>.<genexpr>/s"���� ?�:=�Q�����<�0�0�#�s�"N�TF)rrr��tuple)r�realmrRrsr��reduced_urir�sf&&&& @rB�add_password�HTTPPasswordMgr.add_password(sz����c�3����%�C�����#�!#�D�K�K���'�L��%� ?�:=� ?�%�%� ?�:=� ?�?�K�/3�n�D�K�K���{�+�(rCc���VPPV/4pRFUpVPW$4pVP4F-wrgVF"pVP	W�4'gKVuuu#	K/	KW	R#)Tr�)NN)r�r�r�rz�	is_suburi)	rr��authuri�domainsr��reduced_authuri�uris�authinforRs	&&&      rB�find_user_password�"HTTPPasswordMgr.find_user_password3sf���+�+�/�/�%��,��'�L�"�o�o�g�D�O�")�-�-�/����C��~�~�c�;�;�'�� �#2�(��rCc��\V4pV^,'d'V^,pV^,pV^,;'gRpMRpTpRp\V4wrxV'd,Vf(Ve$R^PRR/PV4p	V	eRWy3,pWV3#)z@Accept authority or URI and extract only the authority and path.rSNrr�i�z%s:%d)rr
r�)
rrRr��partsrYrnrPrs�port�dports
&&&       rBr��HTTPPasswordMgr.reduce_uri=s�����
����8�8��1�X�F��a��I���8�?�?�s�D��F��I��D��	�*�
���D�L�V�-?��R��c���s�6�{�
�� �#�t�m�3�	���rCc��W8XdR#V^,V^,8wdR#V^,pVRRR8wd
VR,
pV^,PV4#)zSCheck if test is below base in a URI tree

Both args must be URIs in reduced form.
TFNrSrK)r�)r�base�test�prefixs&&& rBr��HTTPPasswordMgr.is_suburiTsT��
�<����7�d�1�g����a����"�#�;�#���c�M�F��A�w�!�!�&�)�)rCr�N)T)r�r�r�r�r�r�r�r�r�r�r�r�s@rBrr#s#�����	=���.*�*rCc�&a�]tRtRtoRtRtVtR#)ricc�n�\PWV4wr4VeW43#\PVRV4#rE)rr�)rr�r�rsrts&&&  rBr��2HTTPPasswordMgrWithDefaultRealm.find_user_passwordes=��(�;�;�D�<C�E������>�!��1�1�$��g�F�FrCr�N)r�r�r�r�r�r�r�r�s@rBrrcs����G�GrCc�Raa�]tRtRtoV3RltRV3RlltRRltRtRtVt	V;t
#)r imc�2<�/Vn\SV`	4R#rE)�
authenticated�superr�)r�	__class__s&�rBr��%HTTPPasswordMgrWithPriorAuth.__init__os������
���rCc�t<�VPW%4Ve\SV`	RW#V4\SV`	WW44R#rE)�update_authenticatedr�r�)rr�rRrsr��is_authenticatedr�s&&&&&&�rBr��)HTTPPasswordMgrWithPriorAuth.add_passwordss7����!�!�#�8����G� ��s�&�9�
���U��6rCc��\V\4'dV.pRF+pVF"pVPWC4pW PV&K$	K-	R#�TNr�)rrr�r�)rrRr�r�r�r�s&&&   rBr��1HTTPPasswordMgrWithPriorAuth.update_authenticatedzsF���c�3����%�C�'�L���"�o�o�a�>��2B�"�"�;�/��(rCc��RFUpVPW4pVPF1pVPWC4'gKVPV,uu#	KW	R#r�)r�r�r�)rr�r�r�rRs&&   rBr��-HTTPPasswordMgrWithPriorAuth.is_authenticated�sJ��'�L�"�o�o�g�D�O��)�)���>�>�#�7�7��-�-�c�2�2�*�(rC)r�)F)r�r�r�r�r�r�r�r�r�r��
__classcell__)r�r�s@@rBr r ms�����7�C�3�3rCc�a�]tRtRto]P
!R]P4tRRltRt	Rt
RtRtR	t
]t]
tR
tVtR#)r!i�z1(?:^|,)[ 	]*([^ 	,]+)[ 	]+realm=(["']?)([^"']*)\2Nc�d�Vf\4pWnVPPVnR#rE)rr�r�)r�password_mgrs&&rBr��!AbstractBasicAuthHandler.__init__�s'����*�,�L�"�� �K�K�4�4��rCc#�:"�Rp\PPV4F?pVP4wrEpVR9d^RIpVPR\^4WF3x�RpKA	V'g+V'dVP4^,pMRpVR3x�R#R#5i)FNzBasic Auth Realm was unquotedTrk)�"�')r!�rx�finditer�groups�warnings�warn�UserWarning�split)r�header�found_challenge�morYr	r�r�s&&      rB�_parse_realm�%AbstractBasicAuthHandler._parse_realm�s������*�-�-�6�6�v�>�B�#%�9�9�;� �F�5��J�&���
�
�=�)�1�.��/�!�"�O�?��������*�����4�.� ��s�A,B�/B�7$Bc��VPV4pV'gR#RpVFPpVPV4F8wrxVP4R8wdTpKVfK$VPW#V4uu#	KR	Ve\	RX:24hR#)N�basicz@AbstractBasicAuthHandler does not support the following scheme: )�get_allr�rq�retry_http_basic_authr�)	r�authreqrsr	r_�unsupportedr�rYr�s	&&&&&    rB�http_error_auth_reqed�.AbstractBasicAuthHandler.http_error_auth_reqed�s����/�/�'�*�������F�!%�!2�!2�6�!:�
���<�<�>�W�,�"(�K���$� �5�5�d��G�G�";���"�� &�)�*�
*�#rCc��VPPW14wrEVe�V:RV:2pR\P!VP	44PR4,pVP
VPR4V8XdR#VPVPV4VPPW"PR7#R#)Nr�r�r�rW)r�r�r�r�r�r�rn�auth_headerr�r+r<r?)rrsr	r�rs�pw�raw�auths&&&&    rBr��.AbstractBasicAuthHandler.retry_http_basic_auth�s����;�;�1�1�%�>���
�>�!�2�&�C��f�.�.�s�z�z�|�<�C�C�G�L�L�D��~�~�d�.�.��5��=���'�'��(8�(8�$�?��;�;�#�#�C���#�=�=�rCc��\VPR4'd,VPPVP4'gV#VP	R4'g�VPPRVP4wr#RP
W#4P4p\P!V4P4pVPRRP
VP444V#)r��
AuthorizationNz{0}:{1}zBasic {})
r�r�r�rmr�r�r�r�r��standard_b64encoder�r��strip)rr	rsr��credentials�auth_strs&&    rB�http_request�%AbstractBasicAuthHandler.http_request�s�������%7�8�8��{�{�+�+�C�L�L�9�9��J��~�~�o�.�.��;�;�9�9�$����M�L�D�#�*�*�4�8�?�?�A�K��0�0��=�D�D�F�H��'�'��(2�(9�(9�(�.�.�:J�(K�
M��
rCc��\VPR4'dk^�VPu;8:dR8d,MM(VPPVPR4V#VPPVPR4V#)r�r7TF)r�r�r8r�rm)rr	r�s&&&rBr:�&AbstractBasicAuthHandler.http_response�sc���4�;�;� 2�3�3��h�m�m�)�c�)����0�0����t�D������0�0����u�E��rC)r�r�rE)r�r�r�r��re�compile�Ir�r�r�r�r�r�r:�
https_requestr=r�r�r�s@rBr!r!�sM����
���1��D�D�
�B�5�!�**�4
���!�M�"�NrCc�*a�]tRtRtoRtRtRtVtR#)r"i�r�c�D�VPpVPRWaV4pV#)�www-authenticate)rmr�)rr	r^r8r9r_r=r�s&&&&&&  rB�http_error_401�#HTTPBasicAuthHandler.http_error_401s(���l�l���-�-�.@�*-�G�=���rCr�N)r�r�r�r�r�r�r�r�r�s@rBr"r"�s����!�K��rCc�*a�]tRtRtoRtRtRtVtR#)r#ir�c�D�VPpVPRWaV4pV#�zproxy-authenticate)rsr�)rr	r^r8r9r_rnr�s&&&&&&  rB�http_error_407�$ProxyBasicAuthHandler.http_error_407s+��
�H�H�	��-�-�.B�*3�'�C���rCr�N)r�r�r�r�r�r�r�r�r�s@rBr#r#s����'�K��rCc�Ta�]tRtRtoRRltRtRtRtRtRt	R	t
R
tRtVt
R#)
r$iNc��Vf\4pWnVPPVn^Vn^VnRVnR#rE)rr�r��retried�nonce_count�
last_nonce)rr�s&&rBr��"AbstractDigestAuthHandler.__init__%s<���>�$�&�F��� �K�K�4�4�����������rCc��^VnR#��N)rr�s&rB�reset_retry_count�+AbstractDigestAuthHandler.reset_retry_count.s	����rCc��VPVR4pVP^8�d\VPRRVR4hV;P^,
unV'dgVP	4^,pVP4R8XdVP
W54#VP4R8wd\RV,4hR#R#)Ni�zdigest auth failed�digestr�zEAbstractDigestAuthHandler does not support the following scheme: '%s')r�rrrmr�rq�retry_http_digest_authr�)rr�rsr	r_r�rYs&&&&&  rBr��/AbstractDigestAuthHandler.http_error_auth_reqed1s����+�+�k�4�0���<�<�!���C�L�L�#�/C�#�T�+�
+�
�L�L�A��L���]�]�_�Q�'�F��|�|�~��)��2�2�3�@�@�����7�*� �"?�AG�"H�I�I�+�	rCc��VPR^4wr4\\R\V444pVP	W4pV'd{RV,pVP
P
VPR4V8XdR#VPVPV4VPPWPR7pV#R#)rDNz	Digest %srW)r��parse_keqv_list�filter�parse_http_list�get_authorizationr_r�r�r�r+r<r?)rr	r��token�	challenge�chal�auth_val�resps&&&     rBr�0AbstractDigestAuthHandler.retry_http_digest_authEs����:�:�c�1�-����v�d�O�I�,F�G�H���%�%�c�0���"�T�)�H��{�{���t�/�/��6�(�B���'�'��(8�(8�(�C��;�;�#�#�C���#�=�D��K�
rCc���VP:RV:R\P!4:R2pVPR4\	^4,p\
P!V4P4pVR,#)r�r�:N�N)r�time�ctimer��_randombytes�hashlib�sha1�	hexdigest)r�nonce�s�b�digs&&   rB�
get_cnonce�$AbstractDigestAuthHandler.get_cnonceQsR�� �+�+�U�D�J�J�L�A��
�H�H�W���Q��/���l�l�1�o�'�'�)���3�x�rCc��VR,pVR,pVPR4pVPRR4pVPRR4pTPT4wr�TfR#TPP	Y1P
4wr�T
fR#TPeTPTPT4pMRpT
:RT:RT:2p
TP4:RTP:2pTfT	!T!T
4T:RT!T4:24pM�RTPR	49d�Y@P8XdT;P^,
unM
^TnY@nR
TP,pTPT4pT:RT:RT:RR:RT!T4:2	pT	!T!T
4T4pM\RT,4hRT
:R
T:RT:RTP:RT:R2pT'dTRT,,
pT'dTRT,,
pTRT,,
pT'dTRX:RX:R2,
pT# \dR#i;i)r�r#�qop�	algorithm�MD5�opaqueNr�r��,z%08xzqop '%s' is not supported.z
username="z
", realm="z
", nonce="z", uri="z
", response="r�z
, opaque="%s"z
, digest="%s"z, algorithm="%s"z, qop=auth, nc=z
, cnonce=")r��KeyError�get_algorithm_implsr�r�rmr>�get_entity_digestr�r�r�rrr'r)rr	rr�r#r*r+r-�H�KDrsr��entdig�A1�A2�respdig�ncvalue�cnonce�noncebitr�s&&&                 rBr�+AbstractDigestAuthHandler.get_authorization\s���		���M�E���M�E��(�(�5�/�C�����e�4�I��X�X�h��-�F��(�(��3����9���;�;�1�1�%���F����<���8�8���+�+�C�H�H�d�;�F��F����
+�����(����&��
�;���2��5�!�B�%� 8�9�G�
�s�y�y��~�
%����'�� � �A�%� �#$�� �"'���t�/�/�/�G��_�_�U�+�F�+0�'�6�6�1�R�5�Q�H���2���)�G��7�#�=�>�>��
#'��u�c�l�l�")�+����O�f�,�,�D���O�f�,�,�D��"�Y�.�.������H�H�D����g�	��	�s�AH6�6I�Ic�~a�VR8XdRoM(VR8XdRoMVR8XdRoM\RV,4hV3RlpSV3#)r,c�h�\P!VPR44P4#�r�)r �md5r�r"��xs&rBr{�?AbstractDigestAuthHandler.get_algorithm_impls.<locals>.<lambda>�s��'�+�+�a�h�h�w�&7�8�B�B�DrC�SHAc�h�\P!VPR44P4#r>)r r!r�r"r@s&rBr{rB�s��'�,�,�q�x�x��'8�9�C�C�ErCzSHA-256c�h�\P!VPR44P4#r>)r �sha256r�r"r@s&rBr{rB�s��'�.�.����'�):�;�E�E�GrCz.Unsupported digest authentication algorithm %rc�"<�S!V:RV:24#)r�r�)r$�dr2s&&�rBr{rB�s���!�q�!�,�-rC)r�)rr+r3r2s&& @rBr0�-AbstractDigestAuthHandler.get_algorithm_impls�sV������D�A�
�%�
�E�A�
�)�
#�G�A��,�.7�8�9�
9�
-���"�u�rCc��R#rEr�)rr>rs&&&rBr1�+AbstractDigestAuthHandler.get_entity_digest�s��rC)r�rrr�rrE)r�r�r�r�r�r
r�rr'rr0r1r�r�r�s@rBr$r$s4������I�(
�	�<�|� �rCc�2a�]tRtRtoRtRtRtRtRtVt	R#)r%i�z�An authentication protocol defined by RFC 2069

Digest authentication improves on basic authentication because it
does not transmit passwords in the clear.
r���c��\VP4^,pVPRWaV4pVP4V#)�r�)rrmr�r
�rr	r^r8r9r_rs�retrys&&&&&&  rBr��$HTTPDigestAuthHandler.http_error_401�s>������%�a�(���*�*�+=�+/�g�?����� ��rCr�N)
r�r�r�r�r<r�r0r�r�r�r�s@rBr%r%�s �����"�K��M��rCc�.a�]tRtRtoRtRtRtRtVtR#)r&i��Proxy-AuthorizationrMc�d�VPpVPRWaV4pVP4V#r�)rsr�r
rPs&&&&&&  rBr��%ProxyDigestAuthHandler.http_error_407�s4���x�x���*�*�+?�+/�g�?����� ��rCr�N)	r�r�r�r�r�r0r�r�r�r�s@rBr&r&�s����'�K��M��rCc�Ba�]tRtRtoR	RltRtRtRtRtRt	Vt
R#)
�AbstractHTTPHandleri�Nc�p�Ve	WnR#\PPPVnR#rE)rr�HTTPConnection�
debuglevel�_debuglevel)rr[s&&rBr��AbstractHTTPHandler.__init__�s$��)3�)?�:��T�[�[�E_�E_�Ej�Ej��rCc��WnR#rE�r\)r�levels&&rB�set_http_debuglevel�'AbstractHTTPHandler.set_http_debuglevel�s�� �rCc��\PPPVPVP44#rE)rrrZ�_get_content_lengthr>r��rrrs&&rBrd�'AbstractHTTPHandler._get_content_length�s2���{�{�)�)�=�=��L�L���� �"�	"rCc�n�VPpV'g\R4hVPe�VPp\V\4'dRp\V4hVP
R4'gVPRR4VP
R4'g[VP
R4'gDVPV4pVeVPR\	V44MVPRR4TpVP4'd%\VP4wrx\V4wriVP
R4'gVPRV4VPPF?wr�V
P4p
VP
V
4'dK.VPW�4KA	V#)�
no host givenz\POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str.zContent-typez!application/x-www-form-urlencodedr��Transfer-encoding�chunkedrl)rsrr>rrr�r�r�rdr�rr�rr+r�r�)rrrrsr>r9�content_length�sel_hostrY�sel�sel_pathrTr�s&&          rB�do_request_�AbstractHTTPHandler.do_request_�sw���|�|����?�+�+��<�<�#��<�<�D��$��$�$�D����n�$��%�%�n�5�5��/�/�"�7�9��&�&�'7�8�8�#�.�.�/B�C�C�!%�!9�!9�'�!B��!�-��3�3�,�c�.�.A�C��3�3�/��<��������$�W�%5�%5�6�K�F�!+�C���H��!�!�&�)�)��+�+�F�H�=��;�;�1�1�K�D��?�?�$�D��%�%�d�+�+��/�/��<�2�
�rCc	�4�VPpV'g\R4hV!V3RVP/VBpVPVP4\VP4pTPVPP4UUu/uFwrxWv9gK
WxbK	upp4RVR&VP4U	U
u/uFwr�V	P4V
bK	pp	p
VP'd4/pRpW�9d
Wl,W�&WlVPVPVR7VPVP4VPVP VVP#R4R7TP'4pTP*'d"TP*P)4R	TnTP-4TnTP0TnT#uuppiuup
p	i \$dp
\T
4hR	p
?
ii;i TP)4h;i)
z�Return an HTTPResponse object for the request, using http_class.

http_class must implement the HTTPConnection API from http.client.
rhr?r��
ConnectionrT)r_ri)�encode_chunkedN)rsrr?�set_debuglevelr\rrw�updater_rz�titlery�
set_tunnelrrr�r�r>r�rh�getresponser��sockr�r=�reasonr9)r�
http_classr	�http_conn_argsrsr'r_rLrMrTr��tunnel_headers�proxy_auth_hdr�errrzs&&&,           rBr��AbstractHTTPHandler.do_opens���
�x�x����?�+�+�
�t�C�S�[�[�C�N�C��	����)�)�*��s�,�,�-��������):�):�)<�-�)<����+����)<�-�	.�!(����6=�m�m�o�F�o���4�:�:�<��$�o��F������N�2�N��(�18�1H��.��+�
�L�L��)�)�>�L�B�		�
$��	�	�#�.�.�*�C�L�L�#�(�(�G�),���8K�)L��N��
�
��A�
�6�6�6�
�F�F�L�L�N��A�F�� � �"�����������e-��G�� �
$��s�m�#��
$��	�
�G�G�I��s=�
G
�G
�G �(AG&�/H�&H�1G<�<H�H�Hr_rE)r�r�r�r�r�rardror�r�r�r�s@rBrXrX�s'����k�!�"�
$�L@�@rCrXc�>a�]tRtRtoRt]PtRtVt	R#)r'iCc�V�VP\PPV4#rE)r�rrrZ�rr	s&&rB�	http_open�HTTPHandler.http_openEs���|�|�D�K�K�6�6��<�<rCr�N)
r�r�r�r�r�rXror�r�r�r�s@rBr'r'Cs����=�'�2�2�LrCrc�Ha�]tRtRtoRRltRt]PtRt	Vt
R#)r:iLNc�2�VeTM#\PPPp\PW4VfD\PPPp\PPV4pVeW2nW n	R#rE)
rrrr[rXr��	_http_vsn�_create_https_context�check_hostname�_context)rr[r7r��http_versions&&&& rBr��HTTPSHandler.__init__Nsk��'1�'=��4�;�;�C^�C^�Ci�Ci�J��(�(��:���#�{�{�:�:�D�D���+�+�;�;�L�I���)�)7�&�#�MrCc�n�VP\PPVVPR7#)r9)r�rrrr�r�s&&rB�
https_open�HTTPSHandler.https_openXs-���<�<���� ;� ;�S�(,�
�
� �7�
7rC)r��NNN)r�r�r�r�r�r�rXror�r�r�r�s@rBr:r:Ls����	$�	7�,�7�7�
rCr:c�>a�]tRtRtoRRltRtRt]t]tRt	Vt
R#)ri`Nc�V�^RIpVfVPP4pWnR#r)�http.cookiejar�	cookiejar�	CookieJar)rr�rs&& rBr��HTTPCookieProcessor.__init__as"��������0�0�2�I�"�rCc�<�VPPV4V#rE)r��add_cookie_headerres&&rBr�� HTTPCookieProcessor.http_requestgs�����(�(��1��rCc�<�VPPW!4V#rE)r��extract_cookies)rrrr�s&&&rBr:�!HTTPCookieProcessor.http_responseks�����&�&�x�9��rC)r�rE)r�r�r�r�r�r�r:r�r=r�r�r�s@rBrr`s ����#���!�M�"�NrCc�&a�]tRtRtoRtRtVtR#)r,irc�>�VPp\RV,4h)zunknown url type: %s)r�r)rr	r�s&& rBr�UnknownHandler.unknown_openss���x�x���-��4�5�5rCr�N)r�r�r�r�rr�r�r�s@rBr,r,rs����6�6rCc��/pVF<pVPR^4wr4V^,R8XdVR,R8XdV^RpWAV&K>	V#)z>Parse list of key=value strings where keys are not duplicated.�=r�rK)r�)�l�parsed�eltrLrMs&    rBrrwsQ��
�F����y�y��a� ����Q�4�3�;�1�R�5�C�<��!�B��A��q�	�	�
�MrCc�j�.pRpR;r4VFjpV'd
W%,
pRpKV'dVR8XdRpK*VR8XdRpW%,
pK=VR8XdVPV4RpKYVR8XdRpW%,
pKl	V'dVPV4VUu.uFq"P4NK	up#uupi)aXParse lists as described by RFC 2068 Section 2.

In particular, parse comma-separated lists where the elements of
the list may include quoted-strings.  A quoted-string could
contain a comma.  A non-quoted string could have quotes in the
middle.  Neither commas nor quotes count if they are escaped.
Only double-quotes count, not single-quotes.
rkF�\Tr�r.)rVr�)r$�res�part�escaper	�curs&     rBrr�s���
�C�
�D���F�����K�D��F����d�{����������K�D���#�:��J�J�t���D���#�:��E����-�2��
�
�4��%(�)�S�T�J�J�L�S�)�)��)s�B0c�4a�]tRtRtoRtRtRt]tRtVt	R#)r(i�Nc���\Pfv\\P!R4^,\P!\P
!44^,,4\n\P#\P# \Pd3\P!R43\n\P#i;i)N�	localhost)r(�namesr�r�gethostbyname_ex�gethostname�gaierror�
gethostbynamer�s&rB�	get_names�FileHandler.get_names�s������$�
I�$)��+�+�K�8��;��+�+�F�,>�,>�,@�A�!�D�E�%F��!�
� � � �{� � � ���?�?�
I�%+�%9�%9�+�%F�$H��!�� � � �
I�s�A$B�5C�Cc���^RIp^RIp\VPRRR7p\P
!V4pVPpVPPVPRR7pVPV4^,pVP!RT;'gRWg3,4p	\VRR7p
\\VR4W�4# \dp\!Y�P"4hRp?ii;i)	r	NT)�require_scheme�resolve_host)�usegmtz6Content-type: %s
Content-length: %d
Last-modified: %s
z
text/plain)�
add_scheme�rb)�email.utils�	mimetypesr2rmrO�stat�st_size�utils�
formatdate�st_mtime�guess_file_type�message_from_stringr1rr<rhrr[)rr	�emailr��	localfile�statsrc�modified�mtyper_�origurl�exps&&          rB�open_local_file�FileHandler.open_local_file�s����� ����d�QU�V�	�	.��G�G�I�&�E��=�=�D��{�{�-�-�e�n�n�T�-�J�H��-�-�i�8��;�E��/�/�K��&�&�,��7�8�9�G�#�9��>�G��d�9�d�3�W�F�F���	.��3���-�-��	.�s�A6C�1C�C0�C+�+C0r�)
r�r�r�r�r�r�r��	file_openr�r�r�s@rBr(r(�s�����E�!�.�" �IrCc�j�V'dVR8XdR#\P!4pW8XdR#V'gR#\P!V4pT\
4P49# \P\3dLYi;i \P\\
3dR#i;i)r�TF)rr�r��AttributeErrorr��UnicodeEncodeErrorr(r�)rn�resolve�hostname�addresss&&  rB�_is_local_authorityr��s����	�[�0����%�%�'��� ��!�����&�&�y�1���k�m�-�-�/�/�/��
�O�O�^�,�
��
��
�O�O�^�-?�@����s"�A-�B�-B�
B� B2�1B2c�,a�]tRtRtoRtRtRtVtR#)r)i�c���^RIp^RIpVPpV'g\R4h\	V4wrEVfVP
pM\
V4p\V4wrdV'd\V4wrgMRp\V4pT;'gRpT;'gRp\P!V4p\TP4wr�T	PR4p\!\#\T44pTRRTR,r�T'dT^,'g
TR,pTP%YgYEY�P&4p
T;'dR;'gRpT
FAp\)T4wppTP+4R8XgK(TR
9gK1TP-4pKC	T
P/Y�4wppRpTP1TP24^,pT'dTR	T,,
pTeT^8�dTR
T,,
p\4P6!T4p\9TTTP24# \dp\T4hRp?ii;i TP:dp\RT24ThRp?ii;i)r	Nzftp error: no host givenrkrS�rONNr��Dr�zContent-type: %s
zContent-length: %d
�ftp error: rK)�a�Ar�r�rHr�)�ftplibr�rsrr
�FTP_PORTrWrrr
rr�rhrr�r�r��map�connect_ftpr?rrq�upper�retrfile�
guess_typermr�r�r�
all_errors)rr	r�r�rsr�rsr�r9rP�attrs�dirsrG�fwr��attrr�r^�retrlenr_r�r�s&&                    rB�ftp_open�FTPHandler.ftp_open�s%�����x�x����5�6�6���%�
���<��?�?�D��t�9�D� ��%�
���'��-�L�D�&��F��t�}���z�z�r�����2��	 ��'�'��-�D�!����.����z�z�#����C���&�'���#�2�Y��R��d���Q�����8�D�	9��!�!�$��D�+�+�N�B��<�<�C�&�&�3�D���)�$�/���e��:�:�<�6�)��:�:� �;�;�=�D�	�
�+�+�d�1�K�B���G��(�(����6�q�9�E���/�%�7�7���"�w�!�|��1�G�;�;���/�/��8�G��b�'�3�<�<�8�8��1�	 ��3�-���	 ��2� � �	9��[���.�/�S�8��	9�sC�H1�/I�(I�<I�B+I�1I�<I�I�I4� I/�/I4c
� �\WW4WVRR7#)F)�
persistent)�
ftpwrapper)rrsr�rsr�r�r?s&&&&&&&rBr��FTPHandler.connect_ftps���$��D�%*�,�	,rCr�N)r�r�r�r�r�r�r�r�r�s@rBr)r)�s����29�h,�,rCc�Da�]tRtRtoRtRtRtRtRtRt	Rt
VtR	#)
r*ic�L�/Vn/Vn^Vn^<Vn^VnR#r)�cacher?�soonest�delay�	max_connsr�s&rBr��CacheFTPHandler.__init__s%����
���������
���rCc��WnR#rE)r�)r�ts&&rB�
setTimeout�CacheFTPHandler.setTimeout$s���
rCc��WnR#rE)r�)rrJs&&rB�setMaxConns�CacheFTPHandler.setMaxConns's���rCc��WVRPV4V3pWpP9d5\P!4VP,VPV&MM\WW4WV4VPV&\P!4VP,VPV&VP
4VPV,#)rS)�joinr�rr�r?r��check_cache)rrsr�rsr�r�r?r�s&&&&&&& rBr��CacheFTPHandler.connect_ftp*s����$�������7���*�*�� $�	�	��d�j�j� 8�D�L�L���(��t�)-�8�D�J�J�s�O� $�	�	��d�j�j� 8�D�L�L��������z�z�#��rCc���\P!4pVPV8:dp\VPP	44FHwr#W18gK
VP
V,P
4VP
VVPVKJ	\\VPP444Vn\VP
4VP8Xd�\VPP	44F1wr#W0P8XgKVP
VVPVM	\\VPP444VnR#R#rE)rr�r�r?rzr�r��min�valuesrYr�)rr�rLrMs&   rBr�CacheFTPHandler.check_cache5s���I�I�K���<�<�1���T�\�\�/�/�1�2����5��J�J�q�M�'�'�)��
�
�1�
����Q��	3�
�4���� 3� 3� 5�6�7����t�z�z�?�d�n�n�,��T�\�\�/�/�1�2������$��
�
�1�
����Q���	3�
�t�D�L�L�$7�$7�$9�:�;�D�L�
-rCc���VPP4FpVP4K	VPP4VPP4R#rE)r�rr��clearr?)r�conns& rB�clear_cache�CacheFTPHandler.clear_cacheIsB���J�J�%�%�'�D��J�J�L�(��
�
���������rC)r�r�r�r�r?N)r�r�r�r�r�r�r�r�rr	r�r�r�s@rBr*r*s(�������	�<�(�rCc�&a�]tRtRtoRtRtVtR#)r+iOc��VPpVPR^4wr4VPR^4wrT\V4pVPR4'd\P
!V4pVRRpV'gRp\P!RV\V43,4p\\P!V4Wb4#)r�r.z;base64Nztext/plain;charset=US-ASCIIz$Content-type: %s
Content-length: %d
i����)rmr�r�endswithr��decodebytesr�r�rYr�io�BytesIO)rr	r=rYr>�	mediatyper_s&&     rB�	data_open�DataHandler.data_openPs����l�l���y�y��Q�'����*�*�S��+��	� ��%�����i�(�(��%�%�d�+�D�!�#�2��I��5�I��+�+�,T�
��D�	�"�-#�$���"�*�*�T�*�G�9�9rCr�N)r�r�r�r�rr�r�r�s@rBr+r+Os����:�:rCr�r�c��V'g
RV,p\V4R,wr4pVR8wd\R4h\PR8Xd�VR,R8Xd
W@,pM�\	WB4'gRV,V,pMiVR,R	8XdVR
,pMQVR,R8XdVR
,R9d
VR
,pVR,R8XdVR,R,VR,,pVPRR4pM\	WB4'g\R4h\P!4p\P!4p\WVR7#)z�Convert the given file URL to a local file system path.

The 'file:' scheme prefix must be omitted unless *require_scheme*
is set to true.

The URL authority may be resolved with gethostbyname() if
*resolve_host* is set to true.
�file:�N�NrGzURL is missing a 'file:' scheme�nt:rOr6Nr�rj�///r�:NrONrS:r6rN�|:r6NNr�z-file:// scheme is supported only on localhost�rT�errors)r�r)
rrrOrTr�rHr�getfilesystemencoding�getfilesystemencodeerrorsr
)r=r�r�rYrnrTrs&$$    rBr2r2ps�����m��%�c�]�2�.��F�s�
����8�9�9�	�w�w�$���S�>�S� ��/�C�$�Y�=�=���"�S�(�C�
��W��
��b�'�C��2�w�#�~�#�c�(�j�"8��"�g���3�x�3���"�g��m�c�"�g�-���k�k�#�t�$��
 ��
9�
9��F�G�G��(�(�*�H�
�
*�
*�
,�F��3�&�9�9rCr�c�J�\PR8XdVPRR4p\P!4p\P
!4pV'dRMRp\PPV4wrVpV'djVR,R8Xd6VR,pVR,P4R	8XdR
VR,,pVR,R8Xd
R
V,p\WRVRR7pMV'd
R
V,p\WrVR7pWE,V,V,#)z�Convert the given local file system path to a file URL.

The 'file:' scheme prefix is omitted unless *add_scheme*
is set to true.
rr�rSrrk�N�Nz//?/:r!NNzUNC/rjr�r�rz/:)rTrrUr)
rOrTrHrrrrP�	splitrootr�r	)�pathnamer�rTrrY�drive�root�tails&$      rBr1r1�s���
�w�w�$���#�#�D�#�.���(�(�*�H�
�
*�
*�
,�F�"�W��F����)�)�(�3��E�����9����"�I�E��R�y��� �F�*��u�R�y�(����9����E�M�E��e�v�D�I��	
�
�d�{�����8�D��>�D� �4�'�'rCc�J�\f\P!R4s\#)z8Return the IP address of the magic hostname 'localhost'.r�)�
_localhostrr�r�rCrBr�r��s �����)�)�+�6�
��rCc�*�\fA\\P!\P!44^,4s\#\# \P
d/\\P!R4^,4s\#i;i)z,Return the IP addresses of the current host.r�)�	_thishostr�rr�r�r�r�rCrB�thishostr+�sw����	G��f�5�5�f�6H�6H�6J�K�A�N�O�I���9������	G��f�5�5�k�B�1�E�F�I���	G�s�9A�;B�Bc�>�\f^RIpVPs\#)z1Return the set of errors raised by the FTP class.N)�
_ftperrorsr�r�)r�s rB�	ftperrorsr.�s������&�&�
��rCc�J�\f\P!R4s\#)z%Return an empty email Message object.rk)�
_noheadersr�r�r�rCrB�	noheadersr1�s �����.�.�r�2�
��rCc�Ra�]tRtRtoRtRRltRtRtRtRt	R	t
R
tRtVt
R#)
r�i�z;Class used by open_ftp() for cache of open FTP connections.Nc��WnW nW0nW@nWPnW`n^VnWpnVP4R# TP4h;ir)
rsr�rsr�r�r?�refcount�	keepalive�initr�)rrsr�rsr�r�r?r�s&&&&&&&&rBr��ftpwrapper.__init__�sM���	����	��	��	�����
�#��	��I�I�K��	��J�J�L��s�A�Ac��^RIp^VnVP4VnVPP	VP
VPVP4VPPVPVP4RPVP4pVPPV4R#)r	NrS)r��busy�FTPrX�connectrsr�r?�loginrsr�r�r��cwd)rr��_targets&  rBr6�ftpwrapper.init�sw�����	��:�:�<�����������D�I�I�t�|�|�<������t�y�y�$�+�+�.��(�(�4�9�9�%�������W�rCc��^RIpVP4VR9dRp^pMRV,p^pVPPV4RpV'd0V'g(RV,pVPP
V4wrgV'g�VPPR4V'd^VPP4p	VPPV4TPPT	4R	T,pMR
pVPP
V4wrg^Vn\VPR4VP4p
V;P ^,
unVP#4V
X3# TPd0TP4TPPT4ELxi;i TPd2p\T4R,R8wd\RT24ThRp?EL�Rp?ii;i TPdp\RT,4ThRp?ii;i TPPT	4i;i)
r	NzTYPE AzTYPE zRETR r�550r�z
ftp error: %rzLIST �LISTr�)rHr�)r��endtransferrX�voidcmdr�r6�ntransfercmd�
error_permrr�pwdr=r9r�makefile�
file_closer4r�)rrGr�r��cmd�isdirrr�rzrG�ftpobjs&&&        rBr��ftpwrapper.retrfile�s���������:��X�s�q�u��d�N�c�A�E�	"��H�H���S�!�����
G���n�� $��� 5� 5�c� :�
����H�H���X�&���h�h�l�l�n��&�M������T�*��H�H�L�L��%���n���� �H�H�1�1�#�6�M�D���	��d�m�m�D�1�4�?�?�C���
�
���
��
�
���� � ��G� � �	"��I�I�K��H�H���S�!�	"���$�$�
G��v�;�r�?�e�+�"�[���#9�:��F�,��
G��"�,�,�M�&���'?�@�f�L��M���H�H�L�L��%�sM�F�&G�H	�<G�G�H�&H�H�	H2�H-�-H2�2H5�5Ic��VP'gR#^VnVPP4R# \4dR#i;irE)r9rX�voidrespr.r�s&rBrC�ftpwrapper.endtransfer+s>���y�y�y����	�	��H�H������{�	��	�s�9�A�Ac�Z�RVnVP^8:dVP4R#R#)FN)r5r4�
real_closer�s&rBr��ftpwrapper.close4s$������=�=�A���O�O��rCc���VP4V;P^,unVP^8:d'VP'gVP4R#R#R#)rON)rCr4r5rRr�s&rBrI�ftpwrapper.file_close9sB�������
�
���
��=�=�A��d�n�n�n��O�O��'5�rCc��VP4VPP4R# \4dR#i;irE)rCrXr�r.r�s&rBrR�ftpwrapper.real_close?s5������	��H�H�N�N����{�	��	�s�.�A�A)
r9r�rXrsr5r�r�r4r?rs)NT)r�r�r�r�r<r�r6r�rCr�rIrRr�r�r�s@rBr�r��s1����E�� �*!�X��
��rCr�c��/p.p\PF�p\V4^8�gKVR,R8XgK%VRRP4R8XgK?\PV,pVRRP4pVP	W#V34V'gK�W0V&K�	R\P9dVPRR4VF2wr#pVRRR8XgKV'dW0V&K VPVR4K4	V#)	z�Return a dictionary of scheme -> proxy server URL mappings.

Scan the environment for variables named <scheme>_proxy;
this seems to be the standard convention.
r�Nrl�REQUEST_METHODr�_proxyi�������)rO�environrYrqrVr�)r}�environmentrTr��
proxy_names     rB�getproxies_environmentr_Gs����G��K��
�
���t�9�q�=�T�"�X��_��b�c����1B�g�1M��J�J�t�$�E��c�r����*�J�����Z�8�9��u�&+�
�#���2�:�:�%����F�D�!�#.���Z����9�� ��&+�
�#����J��-�
$/��NrCc���Vf\4pVR,pTR8XdR#TP4p\T4wr4TP	R4F�pTP4pT'gKTP
R4pTP4pY58XgY8XdR#RT,pTPT4'gTPT4'gK�R#	R# \dR#i;i)z�Test if proxies should not be used for a particular host.

Checks the proxy dict for the value of no_proxy, which should
be a list of comma separated DNS suffixes, or '*' for all hosts.

�noF�*Tr.�.)r_r/rqr
r�r��lstripr
)rsr}�no_proxy�hostonlyr�rTs&&    rB�proxy_bypass_environmentrgjs�����(�*����4�=���3����:�:�<�D���%�N�H����s�#���z�z�|���4��;�;�s�#�D��:�:�<�D���4�<����:�D�� � ��&�&�$�-�-��*=�*=��$���)����s�	C�C,�+C,c��^RIHp^RIHpHp\	V4wrVRpRV9dVR,'dR#Rp\V!V44pVP
RR4F�p	V	'gK
\P!R	V	4p
V
e�Ve�V!V
P^44pV
P^4pVf0^V
P^4PR4^,,pM\VR
,4pV^8gV^ 8�dK�^ V,
pW�,	W�,	8XdR#K�V!W	4'gK�R#	R# TdL�i;i)
aJ
Return True iff this host shouldn't be accessed using a proxy

This function uses the MacOSX framework SystemConfiguration
to fetch the proxy information.

proxy_settings come from _scproxy._get_proxy_settings or get mocked ie:
{ 'exclude_simple': bool,
  'exceptions': ['foo.bar', '*.bar.com', '127.0.0.1', '10.1', '10.0/16']
}
��fnmatch)�AddressValueError�IPv4Addressc�*�VPR4p\\\V44p\	V4^8wdV.RO,R,pV^,^,V^,^,,V^,^,,V^,,#)rcr )r	r	r	r	)r�r�r�rWrY)�ipAddrr�s& rB�ip2num�,_proxy_bypass_macosx_sysconf.<locals>.ip2num�sk�����S�!���S��e�_�%���u�:��?��\�)�2�.�E��a��B��5��8�r�>�2�e�A�h�!�m�D�u�Q�x�O�OrCrc�exclude_simpleTN�
exceptionsz(\d+(?:\.\d+)*)(/\d+)?r�Fr�)rj�	ipaddressrkrlr
rWr�r��match�group�count)
rs�proxy_settingsrjrkrlrfr�ro�hostIPr�rJr��masks
&&           rB�_proxy_bypass_macosx_sysconfrz�s/�� �8���%�N�H�P��$���*�+�+��
�F�
��[��*�+�� �#�#�L�"�5���h��H�H�.��6���=�V�/��!�'�'�!�*�%�D��7�7�1�:�D��|��A�G�G�A�J�,�,�S�1�A�5�6���4��8�}���a�x�4�"�9����9�D���D�L�1��2��T�
!�
!��/6�2��9�
��
�s�D>�>E�Ec���^RIHp\V4wrVPR4pVF7pVP4pVR8Xd
RV9dR#K&V!W4'gK6R#	R#)z�Return True if the host should bypass the proxy server.

The proxy override list is obtained from the Windows
Internet settings proxy override registry value.

An example of a proxy override value is:
"www.example.com;*.example.net; 192.168.0.1"
ri�;z<local>rcTF)rjr
r�r�)rs�overriderjr��proxy_overrider�s&&    rB�_proxy_bypass_winreg_overrider�s`�� ����G�D��^�^�C�(�N����z�z�|���9���$����
�T�
 �
 ���rC�darwin)�_get_proxy_settings�_get_proxiesc�,�\4p\W4#rE)r�rz)rsrws& rB�proxy_bypass_macosx_sysconfr��s��,�.��+�D�A�ArCc��\4#)z�Return a dictionary of scheme -> proxy server URL mappings.

This function uses the MacOSX framework SystemConfiguration
to fetch the proxy information.
)r�r�rCrB�getproxies_macosx_sysconfr��s���~�rCc�R�\4pV'd\W4#\V4#)z�Return True, if host should be bypassed.

Checks proxy settings gathered from the environment, if specified,
or from the MacOSX framework SystemConfiguration.

)r_rgr��rsr}s& rBr�r��s%��)�*���+�D�:�:�.�t�4�4rCc�:�\4;'g\4#rE)r_r�r�rCrBr3r3s��%�'�F�F�+D�+F�FrCrc�T�/p^RIpTPTPR4pTP	TR4^,pT'Ed"\TP	TR4^,4pRT9dRT9dRP
T4pTPR4FYpTPR^4wrg\P!RT4'g"TR9dRT,pMTR8Xd
R
T,pYpT&K[	TPR4'd\\P!RRTR,4pTPR	4;'gTTR	&TPR
4;'gTTR
&TP4T# \dTu#i;i \\\3dT#i;i)zhReturn a dictionary of scheme -> proxy server URL mappings.

Win32 uses the registry to store proxies.

N�;Software\Microsoft\Windows\CurrentVersion\Internet Settings�ProxyEnable�ProxyServerr�r|zhttp={0};https={0};ftp={0}z
(?:[^/:]+)://rr�zhttp://�sockszsocks://z	^socks://z	socks4://)rr�rX)�winreg�ImportError�OpenKey�HKEY_CURRENT_USER�QueryValueExrr�r�r�rtr�rp�Closerhr�r�)r}r��internetSettings�proxyEnable�proxyServer�pr�r�s        rB�getproxies_registryr�
s�����	��"	�%�~�~�f�.F�.F�N� P�� �-�-�.>�/<�>�>?�A�K��{�!�&�"5�"5�6F�7D�#F�FG�#I�J���k�)�c��.D�">�"E�"E�k�"R�K�$�*�*�3�/�A�()����Q��%�H��8�8�O�W�=�=�#�'?�?�&/�'�&9�G�%��0�&0�7�&:�G�(/�H�%�0��;�;�w�'�'� �f�f�\�;���@P�Q�G�&-�k�k�&�&9�&D�&D�W�G�F�O�'.�{�{�7�';�'F�'F�w�G�G�$��"�"�$����M�	��N�	��B��Y�/�	�
���	�s;�E:�=F
�CF
�
6F
�F
�"F
�:
F
�	F
�
F'�&F'c�:�\4;'g\4#)z�Return a dictionary of scheme -> proxy server URL mappings.

Returns settings gathered from the environment, if specified,
or the registry.

)r_r�r�rCrBr3r3;s��&�'�@�@�+>�+@�@rCc�>�^RIpTPTPR4pTP	TR4^,p\TP	TR4^,4pT'd	T'gR#\Y4# \dR#i;i \dR#i;i)r	NFr�r��
ProxyOverride)r�r�r�r�r�rrhr)rsr�r�r��
proxyOverrides&    rB�proxy_bypass_registryr�Ds���	��		�%�~�~�f�.F�.F�N� P�� �-�-�.>�/<�>�>?�A�K��� 3� 3�4D�5D�!F�FG�!I�J�M�
�-��,�T�A�A���	��	���	��	�s#�A;�AB
�;B
�	B
�
B�Bc�R�\4pV'd\W4#\V4#)zReturn True, if host should be bypassed.

Checks proxy settings gathered from the environment, if specified,
or the registry.

)r_rgr�r�s& rBr�r�Xs%��)�*���+�D�:�:�(��.�.rCr�rE)vr<r�r�rLr�r �http.clientrrrOr�rr[rrrR�urllib.errorrrr�urllib.parserrrrr	r
rrr
rrrrrrr�urllib.responserr�ssl�	_have_sslr��__all__�version_infor�r;rr.r/rUr4r5r��ASCIIrortrrr0rr-rrrurrrr r!r"r#�urandomrr$r%r&rXr'r�rr:rVrr,rrr(r�r)r*r+r2r1r(r�r*r+r-r.r0r1r�r_rgrzr�platform�_scproxyr�r�r�r�r�r3rTr�r�r�rCrB�<module>r�s���C�f�
�����	�	�	�
�
�
���C�B�"�"�"�"�"�
5����I��
����!.��0I����1��3A���	�9�	�
#��
%?���
�4�
�6Q�
���6��8E���� ��"3��5B����+���� ��"0����#��%1���� ���$��(�(��,�,��
���F�$B�$B�2+��2+�h���:�x��z�z�(�B�H�H�-��� k"�k"�ZI+�I+�^"�H8�8�&#��#�";�k�;�o2�+�o2�d,�B)>�;�)>�V=*�=*�@G�o�G�3�#B�3�>l#�l#�`�3�[���4�k�� �z�z��R�R�j�K�)B��$
�[�*C�
�s�+�s�l3�%�3��4�;�;�)�*�*�8�*�8�$�N�N�>�"�#�+�#�$6�[�6�
�)*�V �+� �B0�(7,��7,�r3�j�3�j:�+�:�B$:��$:�E�$:�N (�� (�J�
��
�	���
���
��a�a�H!�F �J<�@�0�<�<�8��:�B��5�G��W�W��_�/�bA�B�(/�(�J�+�L��s?���I��s�2K4�4	L�L