python (3.12.0)

(root)/
lib/
python3.12/
http/
__pycache__/
client.cpython-312.opt-1.pyc

̑eRdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Zddlm
Z
gdZdZdZdZdZd	Zd
Zej-ej.j0ej.j0j3Dcic]}||j4c}ZdZdZej<d
j>Z ej<djBZ"ej<dZ#ej<dZ$hdZ%d;dZ&GddejNjPZ)dZ*e)fdZ+e)fdZ,GddejZZ.dZ/GddZ0	ddl1Z1Gdde0Z2ejgdGdd e5Z6Gd!d"e6Z7Gd#d$e6Z8Gd%d&e6Z9Gd'd(e6Z:Gd)d*e6Z;Gd+d,e6Z<Gd-d.e6Z=Gd/d0e=Z>Gd1d2e=Z?Gd3d4e=Z@Gd5d6e6ZAGd7d8e6ZBGd9d:eCeAZDe6ZEycc}w#e4$rYwxYw)<a
HTTP/1.1 client library

<intro stuff goes here>
<other stuff, too>

HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:

    (null)
      |
      | HTTPConnection()
      v
    Idle
      |
      | putrequest()
      v
    Request-started
      |
      | ( putheader() )*  endheaders()
      v
    Request-sent
      |\_____________________________
      |                              | getresponse() raises
      | response = getresponse()     | ConnectionError
      v                              v
    Unread-response                Idle
    [Response-headers-read]
      |\____________________
      |                     |
      | response.read()     | putrequest()
      v                     v
    Idle                  Req-started-unread-response
                     ______/|
                   /        |
   response.read() |        | ( putheader() )*  endheaders()
                   v        v
       Request-started    Req-sent-unread-response
                            |
                            | response.read()
                            v
                          Request-sent

This diagram presents the following rules:
  -- a second request may not be started until {response-headers-read}
  -- a response [object] cannot be retrieved until {request-sent}
  -- there is no differentiation between an unread response body and a
     partially read response body

Note: this enforcement is applied by the HTTPConnection class. The
      HTTPResponse class does not enforce this state machine, which
      implies sophisticated clients may accelerate the request/response
      pipeline. Caution should be taken, though: accelerating the states
      beyond the above pattern may imply knowledge of the server's
      connection-close behavior for certain requests. For example, it
      is impossible to tell whether the server will close the connection
      UNTIL the response headers have been read; this means that further
      requests cannot be placed into the pipeline until it is known that
      the server will NOT be closing the connection.

Logical State                  __state            __response
-------------                  -------            ----------
Idle                           _CS_IDLE           None
Request-started                _CS_REQ_STARTED    None
Request-sent                   _CS_REQ_SENT       None
Unread-response                _CS_IDLE           <response_class>
Req-started-unread-response    _CS_REQ_STARTED    <response_class>
Req-sent-unread-response       _CS_REQ_SENT       <response_class>
N)urlsplit)HTTPResponseHTTPConnection
HTTPExceptionNotConnectedUnknownProtocolUnknownTransferEncodingUnimplementedFileModeIncompleteRead
InvalidURLImproperConnectionStateCannotSendRequestCannotSendHeaderResponseNotReady
BadStatusLineLineTooLongRemoteDisconnectederror	responsesPiUNKNOWNIdlezRequest-startedzRequest-sentids[^:\s][^:\r\n]*s\n(?![ \t])|\r(?![ \t\n])z[- ]z[-]>PUTPOSTPATCHc
	|jdS#t$rl}t|j|j|j|j
|j
d||j|j
dd|ddd}~wwxYw)z<Call data.encode("latin-1") but show a better error message.latin-1z (z.20z) is not valid Latin-1. Use z9.encode('utf-8') if you want to send it encoded in UTF-8.N)encodeUnicodeEncodeErrorencodingobjectstartendtitle)datanameerrs   ?/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/http/client.py_encoder*s}
E{{9%%E LLJJIIGGZZ\4		#''2D
:;AE	EEs	BA'BBceZdZdZy)HTTPMessagec|jdz}t|}g}d}|jD]D}|d|j|k(rd}n|ddjsd}|s4|j	|F|S)aFind all header lines matching a given header name.

        Look through the list of headers and find all lines matching a given
        header name (and their continuation lines).  A list of the lines is
        returned, without interpretation.  If the header does not occur, an
        empty list is returned.  If the header occurs multiple times, all
        occurrences are returned.  Case is not important in the header name.

        :rN)lowerlenkeysisspaceappend)selfr'nlsthitlines      r)getallmatchingheadersz!HTTPMessage.getallmatchingheadersszz|c!IIIK	!DBQx~~4'"1X%%'

4 
	!
N)__name__
__module____qualname__r:r;r)r,r,sr;r,cg}	|jtdz}t|tkDrtd|j	|t|t
kDrt
dt
z|dvr	|Sr)zReads potential header lines into a list from a file pointer.

    Length of line is limited by _MAXLINE, and number of
    headers is limited by _MAXHEADERS.
    r/zheader linezgot more than %d headers

r;)readline_MAXLINEr1rr4_MAXHEADERSr)fpheadersr9s   r)
_read_headersrIstG
{{8a<(t9xm,,tw<+% :[ HII((Nr;cdj|jd}tjj	|j|S)aJ
    Parses only RFC2822 headers from header lines.

    email Parser wants to see strings rather than bytes.
    But a TextIOWrapper around self.rfile would buffer too many bytes
    from the stream, bytes which we later need to read as bytes.
    So we read the correct bytes here, as bytes, for email Parser
    to parse.

    r;
iso-8859-1)_class)joindecodeemailparserParserparsestr)header_linesrLhstrings   r)_parse_header_linesrUs@hh|$++L9G<<f-66w??r;c0t|}t||S)z0Parses only RFC2822 headers from a file pointer.)rIrU)rGrLrHs   r)
parse_headersrWsBGw//r;ceZdZddZdZdZdZdZfdZfdZ	dZ
d	Zd d
ZdZ
dZd
ZdZd dZdZdZdZd!dZd!dZd!fd	ZdZdZdZd dZdZdZdZdZdZ xZ!S)"rc|jd|_||_||_dx|_|_t|_t|_t|_	t|_
t|_t|_t|_
y)Nrb)makefilerG
debuglevel_methodrHmsg_UNKNOWNversionstatusreasonchunked
chunk_leftlength
will_close)r5sockr\methodurls     r)__init__zHTTPResponse.__init__se--%$#'&tx ""r;clt|jjtdzd}t	|tkDrtd|jdkDrtdt||std	|jdd\}}}|jd	s|jt|	t}|d
ks|dkDrt|	||fS#t$r-	|jdd\}}d}n#t$rd}YnwxYwYwxYw#t$rt|wxYw)Nr/rKzstatus linerzreply:z-Remote end closed connection without responsezHTTP/ri)strrGrDrEr1rr\printreprrsplit
ValueError
startswith_close_connrint)r5r9r`rarbs     r)_read_statuszHTTPResponse._read_statussD477##HqL1<@t9xm,,??Q(DJ'%&12
2	&*jjq&9#GVV!!'*%%	&[F|v|#D)) ,&&%	
"&**T1"5

		 	&%%	&sB<C%? D%	D/DDDDDDDD3c|jy	|j\}}}|tk7rn2t|j}|j
dkDrt
d|~P|x|_|_|j|_
|dvrd|_n$|jdrd|_nt|t|jx|_|_|j
dkDr2|jj!D]\}}t
d|d	z||jj#d
}|r"|j%dk(rd|_d|_nd|_|j+|_d|_|jj#d
}|r4|j&s(	t1||_|j.dkrd|_nd|_|t4k(s%|t6k(sd|cxkrdksn|j8dk(rd|_|j,s"|j&s|j.d|_yyyy#t2$r
d|_YvwxYw)NTrzheaders:)zHTTP/1.0zHTTP/0.9
zHTTP/1.header:r.transfer-encodingrcFcontent-lengthrHEAD)rHrvCONTINUErIrGr\rocoderastriprbr`rsrrWr^itemsgetr0rcrd_check_closerfrerurr
NO_CONTENTNOT_MODIFIEDr])	r5r`rarbskipped_headershdrvaltr_encres	         r)beginzHTTPResponse.begin=s<<#&*&7&7&9#GVV!+DGG4O"j/2#)(	DKlln..DL


	
*DL!'**"/"88tx??Q LL..0
1SisC0
1!!"56flln	1DL"DO DL++-!!"23$,,
'!&k;;?"&DKDK
j Fl$:6CLLF"DK
KK"DO
  #
#"
#s H22IIcF|jjd}|jdk(r|rd|jvryy|jjdry|rd|jvry|jjd}|rd|jvryy)N
connectionrycloseTFz
keep-alivezproxy-connection)rHrr`r0)r5connpconns   r)rzHTTPResponse._check_closes||-<<24::</<<L)LDJJL0  !34\U[[]2r;cJ|j}d|_|jyN)rGr)r5rGs  r)rtzHTTPResponse._close_conns
WW

r;c	t||jr|jyy#|jr|jwwxYwr)superrrGrtr5	__class__s r)rzHTTPResponse.closesB	#GMOww  "tww  "s	/Acpt||jr|jjyyr)rflushrGrs r)rzHTTPResponse.flushs%

77GGMMOr;cy)zAlways returns TrueTr?r5s r)readablezHTTPResponse.readablesr;c|jduS)z!True if the connection is closed.N)rGrs r)isclosedzHTTPResponse.isclosedsww$r;c|jy|jdk(r|jy|jr|j	|S||j
||j
kDr|j
}|jj
|}|s|r|j|S|j
:|xj
t|zc_|j
s|j|S|j
|jj
}n#	|j|j
}d|_|j|S#t$r|jwxYw)z?Read and return the response body, or up to the next amt bytes.r;r~r)
rGr]rtrc
_read_chunkedrereadr1
_safe_readr)r5amtss   r)rzHTTPResponse.reads277?<<6!<<%%c**?{{&3+<kkS!A  "
H	(s1v%{{$$&H{{"GGLLN4A H&$$&sE		E$c|jy|jdk(r|jy|jr|j	|S|j
0t
||j
kDrt|d|j
}|jj|}|s|r|j|S|j
1|xj
|zc_|j
s|j|S)z^Read up to len(b) bytes into bytearray b and return the number
        of bytes read.
        rr~)	rGr]rtrc_readinto_chunkedrer1
memoryviewreadinto)r5br6s   r)rzHTTPResponse.readintos
77?<<6!<<))!,,;;"1v#qM!DKK0

GGQQ

	[[
$KK1K;;  "r;c|jjtdz}t|tkDrt	d|jd}|dk\r|d|}	t
|dS#t$r|jwxYw)Nr/z
chunk size;r)	rGrDrEr1rfindrurrrt)r5r9is   r)_read_next_chunk_sizez"HTTPResponse._read_next_chunk_sizesww1-t9xl++IIdO68D	tR= 	
		sA((Bc	|jjtdz}t|tkDrt	d|sy|dvryH)Nr/ztrailer linerA)rGrDrEr1rr5r9s  r)_read_and_discard_trailerz&HTTPResponse._read_and_discard_trailer"sO77##HqL1D4y8#!.11,,r;c|j}|sR||jd	|j}|dk(r"|j|j
d}||_|S#t$rt	dwxYw)Nrlr;r)rdrrrrrrrt)r5rds  r)_get_chunk_leftzHTTPResponse._get_chunk_left0s__
%"
*!779
Q..0  "!
(DO
*$S))
*sA##A8cg}	|jx}s|0||kr+|j|j|||z
|_nA|j|j||||z}d|_|jx}sdj	|S#t
$r }tdj	||d}~wwxYwNrr;)rr4rrdrMr)r5rvaluerdexcs     r)rzHTTPResponse._read_chunkedHs
	;!%!5!5!77:D?sj'8LL!56&03&6DOT__Z89?:%C"#"&!5!5!77:D88E?"	; %1s:	;sBB	B	C#B>>Cc<d}t|}		|j}||St||kr |j|}||z
|_||zS|d|}|j|}||d}||z
}d|_j#t
$rtt
|d|wxYw)Nr)rrr1_safe_readintordrbytes)r5rtotal_bytesmvbrdr6temp_mvbs       r)rzHTTPResponse._readinto_chunkedZsm	:!113
%&&s8z)++C0A&01nDO&?*{
+''1!"gq "# 	: q;'7!899	:sA:-A:(A::!Bc|jj|}t||krt||t|z
|S)aRead the number of bytes requested.

        This function should be used when <amt> bytes "should" be present for
        reading. If the bytes are truly not available (due to EOF), then the
        IncompleteRead exception can be used to detect the problem.
        )rGrr1r)r5rr&s   r)rzHTTPResponse._safe_readrs;ww||C t9s? s3t9}55r;ct|}|jj|}||krtt	|d|||z
|S)z2Same as _safe_read, but for reading into a buffer.N)r1rGrrr)r5rrr6s    r)rzHTTPResponse._safe_readinto~sF!fGGQs7 q!us1u55r;c|j|jdk(ry|jr|j|S|j |dks||jkDr|j}|jj|}|s|r|j
|S|j|xjt|zc_|S)zvRead with at most one underlying system call.  If at least one
        byte is buffered, return that instead.
        r~r;r)rGr]rc_read1_chunkedreread1rtr1)r5r6results   r)rzHTTPResponse.read1s77?dllf4<<&&q));;"AT[[Aq!!
[[
$KK3v;&K
r;c|j|jdk(ry|jr|j|S|jj	|S)Nr~r;)rGr]rc
_peek_chunkedpeek)r5r6s  r)rzHTTPResponse.peeksE77?dllf4<<%%a((ww||Ar;c|j|jdk(ry|jrt||S|j
 |dks||j
kDr|j
}|jj	|}|s|r|j
|S|j
|xj
t|zc_|S)Nr~r;r)rGr]rcrrDrertr1)r5limitrrs   r)rDzHTTPResponse.readlines77?dllf4<<7#E**;;"	UT[[5HKKE!!%(%
[[
$KK3v;&K
r;c|j}||dk(ryd|cxkr|ksn|}|jj|}|xjt	|zc_|std|Sr)rrGrrdr1r)r5r6rdrs    r)rzHTTPResponse._read1_chunkedsj))+
aQ$*$Aww}}Q3t9$ %%r;c	|j}|y|jj|d|S#t$rYywxYw)Nr;)rrrGr)r5r6rds   r)rzHTTPResponse._peek_chunkedsP	--/Jww||J'44
		s3	??c6|jjSr)rGfilenors r)rzHTTPResponse.filenosww~~r;c|j
t|jj|xs|}t|tst|ds|Sdj
|S)axReturns the value of the header matching *name*.

        If there are multiple matching headers, the values are
        combined into a single string separated by commas and spaces.

        If no matching header is found, returns *default* or None if
        the *default* is not specified.

        If the headers are unknown, raises http.client.ResponseNotReady.

        __iter__z, )rHrget_all
isinstancernhasattrrM)r5r'defaultrHs    r)	getheaderzHTTPResponse.getheadersW<<"$$,,&&t,7gs#77J+GN99W%%r;ct|j
tt|jjS)z&Return list of (header, value) tuples.)rHrlistrrs r)
getheaderszHTTPResponse.getheaderss-<<"$$DLL&&())r;c|Srr?rs r)rzHTTPResponse.__iter__sr;c|jS)ajReturns an instance of the class mimetools.Message containing
        meta-information associated with the URL.

        When the method is HTTP, these headers are those returned by
        the server at the head of the retrieved HTML page (including
        Content-Length and Content-Type).

        When the method is FTP, a Content-Length header will be
        present if (as is now usual) the server passed back a file
        length in response to the FTP retrieval request. A
        Content-Type header will be present if the MIME type can be
        guessed.

        When the method is local-file, returned headers will include
        a Date representing the file's last-modified time, a
        Content-Length giving file size, and a Content-Type
        containing a guess at the file's type. See also the
        description of the mimetools module.

        )rHrs r)infozHTTPResponse.infos*||r;c|jS)aZReturn the real URL of the page.

        In some cases, the HTTP server redirects a client to another
        URL. The urlopen() function handles this transparently, but in
        some cases the caller needs to know which URL the client was
        redirected to. The geturl() method can be used to get at this
        redirected URL.

        )rirs r)geturlzHTTPResponse.geturls
xxr;c|jS)zuReturn the HTTP status code that was sent with the response,
        or None if the URL is not an HTTP URL.

        )rars r)getcodezHTTPResponse.getcodes
{{r;)rNNr))"r<r=r>rjrvrrrtrrrrrrrrrrrrrrrrDrrrrrrrrr
__classcell__rs@r)rrs#<'BF#P:
#
&P D 0;$:0
"
5 &(*
.
r;rctj}|dk(r|jdg|jd|_|S)Nryzhttp/1.1T)ssl_create_default_https_contextset_alpn_protocolspost_handshake_auth)http_versioncontexts  r)_create_https_contextrsC//1Gr""J<0"".&*#Nr;ceZdZdZdZeZeZdZ	dZ
edZedZ
dejddfd	Zd!d
ZdZdZd
ZdZdZdZdZdZdZd"dZ		d#dZdZdZdZdZ dZ!d$dddZ"difdddZ#dZ$d Z%y)%rryzHTTP/1.1r/rc6t|tjS)zFTest whether a file-like object is a text or a binary stream.
        )rio
TextIOBase)streams r)
_is_textIOzHTTPConnection._is_textIO0s&"--00r;c||jtvryyt|dry	t|}|jS#t
$rYnwxYwt
|trt|Sy)aGet the content-length based on the body.

        If the body is None, we set Content-Length: 0 for methods that expect
        a body (RFC 7230, Section 3.3.2). We also set the Content-Length for
        any method if the body is a str or bytes-like object and not a file.
        Nrr)	upper_METHODS_EXPECTING_BODYrrnbytes	TypeErrorrrnr1)bodyrhmvs   r)_get_content_lengthz"HTTPConnection._get_content_length6sq<||~!884 	D!B99		dC t9sA	AAN cR||_||_||_d|_g|_d|_t|_d|_d|_	d|_
i|_d|_|j||\|_|_|j!|jt"j$|_yr)timeoutsource_address	blocksizerg_buffer_HTTPConnection__response_CS_IDLE_HTTPConnection__stater]_tunnel_host_tunnel_port_tunnel_headers_raw_proxy_headers
_get_hostporthostport_validate_hostsocketcreate_connection_create_connection)r5rrrrrs      r)rjzHTTPConnection.__init__Vs,"	  !"&!%!3!3D$!?DIDII&#)":":r;c|jrtd|j||\|_|_|r|j|_n|jjtd|jDsI|jjdjd}d||jfz|jd<yy)aSet up host and port for HTTP CONNECT tunnelling.

        In a connection that uses HTTP CONNECT tunnelling, the host passed to
        the constructor is used as a proxy server that relays all communication
        to the endpoint passed to `set_tunnel`. This done by sending an HTTP
        CONNECT request to the proxy server when the connection is established.

        This method must be called before the HTTP connection has been
        established.

        The headers argument should be a mapping of extra HTTP headers to send
        with the CONNECT request.

        As HTTP/1.1 is used for HTTP CONNECT tunnelling request, as per the RFC
        (https://tools.ietf.org/html/rfc7231#section-4.3.6), a HTTP Host:
        header must be provided, matching the authority-form of the request
        target provided as the destination for the CONNECT request. If a
        HTTP Host: header is not provided via the headers argument, one
        is generated and transmitted automatically.
        z.Can't set up tunnel for established connectionc3BK|]}|jdk(yw)rNr0).0headers  r)	<genexpr>z,HTTPConnection.set_tunnel.<locals>.<genexpr>sO6<<>V+Osidnaasciiz%s:%dHostN)rgRuntimeErrorrrrcopyrclearanyrrN)r5rrrHencoded_hosts     r)
set_tunnelzHTTPConnection.set_tunnelms,99OPP/3/A/A$/M,4,#*<<>D   &&(O$:N:NOO,,33F;BB7KL+2d//61,1D  (Pr;cH|b|jd}|jd}||kDr	t||dzd}|d|}n|j}|r|ddk(r
|ddk(r|dd}||fS#t$r/||dzddk(r
|j}nt	d||dzdzYdwxYw)	Nr.]r/rmznonnumeric port: '%s'r[r)rfindrurrdefault_portr)r5rrrjs     r)rzHTTPConnection._get_hostports<

3A

3A1uOtAaCDz?DBQx((Q348s?Abzd|"OAaCDzR'#00()@4!:)MNNOsA))5B! B!c||_yr)r\)r5levels  r)set_debuglevelzHTTPConnection.set_debuglevels	r;cd|jjd|j|jjdfz}|g}|jjD]+\}}|j
|d|djd-|j
d|jdj|~|j|j|j	}	|j\}}}t|j|_|j d
kDr+|jD]}t#d|j%|t&j(j*k7r/|j-t/d|d
|j1	|j-y#|j-wxYw)NsCONNECT %s:%d %s
rrz: 
rrBr;rhrrzzTunnel connection failed:  )rrr
_http_vsn_strrrr4sendrMresponse_classrgr]rvrIrGrr\rorNhttp
HTTPStatusOKrOSErrorr)	r5connectrHrrresponser`rmessages	         r)_tunnelzHTTPConnection._tunnels)$$V,d.?.?%%g.-00)!11779	GMFENNfXRwd3::9EF	Gw	
		#((7#$&&tyy&F	'/'<'<'>$WdG&3HKK&@D#""556F)V]]_56t)))

 :4&'--/ARSTT*

NNHNNs
*B4F00GcH|jt|jSdS)z
        Returns a dictionary with the headers of the response
        received from the proxy server to the CONNECT request
        sent to set the tunnel.

        If the CONNECT request was not sent, the method returns None.
        N)rrUrs r)get_proxy_response_headersz)HTTPConnection.get_proxy_response_headerss/&&2
  7 78	
	
r;ctjd||j|j|j	|j|jf|j
|j|_	|jjtjtjd|jr|j!yy#t$r(}|jtjk7rYd}~Jd}~wwxYw)z3Connect to the host and port specified in __init__.zhttp.client.connectr/N)sysauditrrr
rrrg
setsockoptrIPPROTO_TCPTCP_NODELAYr-errnoENOPROTOOPTrr1r5es  r)r.zHTTPConnection.connects		'tyy$))D++
YYtyy!4<<1D1DF		II  !3!3V5G5GK
LLN		ww%+++,	s09C	C8C33C8ct|_	|j}|rd|_|j|j}|rd|_|jyy#|j}|rd|_|jwwxYw)z(Close the connection to the HTTP server.N)rrrgrr)r5rgr/s   r)rzHTTPConnection.closesr		!99D 	

H"& H"& s%A(Bc|j'|jr|jn
t|jdkDrtdt
|t|dr|jdkDrtd|j|}|r|jdkDrtd|j|jx}rc|r|jd}tjd|||jj||j|jx}rcytjd||	|jj|y#t$r`t!|t"j$j&r$|D]}|jj|Yytd	t)|zwxYw)
zSend `data' to the server.
        ``data`` can be a string object, a bytes object, an array object, a
        file-like object that supports a .read() method, or an iterable object.
        Nrzsend:rzsending a readableencoding file using iso-8859-1rKzhttp.client.sendz9data should be a bytes-like object or an iterable, got %r)rg	auto_openr.rr\rorprrrrrr5r6sendallrrcollectionsabcIterabletype)r5r&r	datablockds     r)r(zHTTPConnection.sends99~~"n$??Q'4:&4 "*+__T*F$//A-67#yy88)8 ) 0 0 >I		,dI>		!!),	 $yy88)8

		$dD1	GIId#	G$ 8 89)AII%%a() !9;?:!FGG	GsE  AG	1G	c:|jj|y)zuAdd a line of output to the current request buffer.

        Assumes that the line does *not* end with \r\n.
        N)rr4)r5rs  r)_outputzHTTPConnection._outputs
	
Ar;c#@K|jdkDrtd|j|}|r|jdkDrtd|j|jx}r6|r|jd}||j|jx}r5yyw)Nrzreading a readabler@rK)r\rorrrr)r5rrrGs    r)_read_readablezHTTPConnection._read_readables??Q&'*doo)23#==88i8%,,\:	O$==88i8sBBBFc|jjddj|j}|jdd=|j||t	|dr|j|}n	t
||f}|D]e}|s|jdkDrtd |r3|jdk(r$t|d	d
jd|zdz}|j|g|r"|jdk(r|jdyyyy#t$r4	t|}n$#t$rtdt|zwxYwYwxYw)
zSend the currently buffered request and clear the buffer.

        Appends an extra \r\n to the buffer.
        A message_body may be specified, to be appended to the request.
        )r;r;rBNrzAmessage_body should be a bytes-like object or an iterable, got %rrzZero length chunk ignoredryXr$rs0

)rextendrMr(rrLrriterrFr\ro	_http_vsnr1r)r5message_bodyencode_chunkedr^chunkschunks      r)_send_outputzHTTPConnection._send_output)se	
J'll4<<(LLO		##|V,,,\:-
|,+_F

!*9:!dnn&:"5z!nD188AEI!"E		% 

!$..B"6		,'#7~O$!>>!%l!3$>')H*.|*<)=>>>>s*8D	E D,+E,!E

EEc^|jr!|jjrd|_|jtk(rt|_nt|j|j
|||_|xsd}|j||d|d|j}|j|j||jdk(r|sd}|jdrt|\}}}}}|r%	|jd}|j#d	|n|j$r|j$}	|j&}
n|j(}	|j*}
	|	jd}|	j-d
dk\rd|zd
z}|
|j.k(r|j#d	|n(|j1d}|j#d	|d
|
|s|j#ddyyy#t $r|jd}YwxYw#t $r|	jd}YwxYw)a`Send a request to the server.

        `method' specifies an HTTP request method, e.g. 'GET'.
        `url' specifies the object being requested, e.g. '/index.html'.
        `skip_host' if True does not add automatically a 'Host:' header
        `skip_accept_encoding' if True does not add automatically an
           'Accept-Encoding:' header
        N/r&ryrmr*rrrr.r[]zAccept-Encodingidentity)rrrr_CS_REQ_STARTEDr_validate_methodr]_validate_pathr'rJ_encode_requestrQrsrrr 	putheaderrrrrrrrN)r5rhri	skip_hostskip_accept_encodingrequestnetlocnil
netloc_encrrhost_encs            r)
putrequestzHTTPConnection.putrequest_s??t779"DO*<<8#*DL#DLL11f%jSC  &T-?-?@T))'23>>R>>&)19#.Cc3;%+]]7%;
NN6:6((#00#00#yy#yy7#';;w#7yy~*#'(?T#9t000vx8#+??7#;v(D/IJ(0*=(
c.;%+]]6%:
;.7#';;v#67s$?G/!H/HHH,+H,c$|jdS)Nr)r)r5rcs  r)r_zHTTPConnection._encode_requests~~g&&r;crtj|}|r td|d|jdy)z&Validate a method name for putrequest.z)method can't contain control characters.  (found at least )N)$_contains_disallowed_method_pchar_researchrrgroup)r5rhmatchs   r)r]zHTTPConnection._validate_methodsI5;;FC?zJ'',{{}&7q:;
;r;crtj|}|r td|d|jdy)zValidate a url for putrequest.&URL can't contain control characters. rkrlN!_contains_disallowed_url_pchar_rernrro)r5rirps   r)r^zHTTPConnection._validate_pathsL288=EcWM005
/@CD
Dr;crtj|}|r td|d|jdy)z9Validate a host so it doesn't contain control characters.rrrkrlNrs)r5rrps   r)rzHTTPConnection._validate_hostsL288>EdXN005
/@CD
Dr;c|jtk7r
tt|dr|j	d}t|st
d|t|}t|D]r\}}t|dr|j	d||<n-t|trt|j	d||<t||sct
d||dj|}|dz|z}|j|y)	zkSend a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        rrzInvalid header name rzInvalid header value s
	s: N)rr\rrr_is_legal_header_namerrr	enumeraterrurn_is_illegal_header_valuerMrJ)r5rvaluesr	one_valuers      r)r`zHTTPConnection.putheaders
<<?*"$$68$]]7+F$V,ABBf%f-	KLAyy(+%,,Y7q	Is+	N11':q	'q	2 fQi!IJJ	Kv&%%'Vr;rSc||jtk(rt|_n
t|j	||y)zIndicate that the last header line has been sent to the server.

        This method sends the request to the server.  The optional message_body
        argument can be used to pass a message body associated with the
        request.
        r|N)rr\_CS_REQ_SENTrrV)r5rRrSs   r)
endheaderszHTTPConnection.endheaderss3<<?*'DL"$$,~Fr;c.|j|||||y)z&Send a complete request to the server.N)
_send_request)r5rhrirrHrSs      r)rczHTTPConnection.request$s	
63g~Fr;c
td|D}i}d|vrd|d<d|vrd|d<|j||fi|d|vrjd|vrhd	}|j||}|4|P|jd
kDrt	d|zd}|jd
dn|jdt
|nd	}|jD]\}	}
|j|	|
t|trt|d}|j||y)Nc3<K|]}|jywrr
)rks  r)rz/HTTPConnection._send_request.<locals>.<genexpr>+s <q <srr/razaccept-encodingrbr|r{FrzUnable to determine size of %rTzTransfer-EncodingrczContent-Lengthrr|)	frozensetrhrr\ror`rnrrr*r)r5rhrirrHrSheader_namesskipscontent_lengthrrs           r)rzHTTPConnection._send_request)s   <G <<\!!"E+,,-E()-u-</#,6"'!%!9!9$!G!)'??Q.!"BT"IJ)-':IFNN#3S5HI"N!--/	'JCNN3&	'dC 4(D^<r;c|jr!|jjrd|_|jtk7s|jrt	|j|j
dkDr3|j
|j|j
|j}n'|j
|j|j}		|jt|_|jr|j|S||_|S#t$r|jwxYw#|jxYw)a)Get the response from the server.

        If the HTTPConnection is in the correct state, returns an
        instance of HTTPResponse or of whatever object is returned by
        the response_class variable.

        If a request has not been sent or if a previous response has
        not be handled, ResponseNotReady is raised.  If the HTTP
        response indicates that the connection should be closed, then
        it will be closed before the response is returned.  When the
        connection is closed, the underlying socket is closed.
        Nrr%)rrrr~rr\r)rgr]rConnectionErrorrrrf)r5r/s  r)getresponsezHTTPConnection.getresponseWs??t779"DO"<<<'4??"4<<00??Q**499doo26,,+@H**499T\\*JH	
 
$DL""


O#+O#



	NNs$
D(D-D-D**D--E)NN)NF)FFr)&r<r=r>rQr'rr)	HTTP_PORTrrAr\staticmethodrrr_GLOBAL_DEFAULT_TIMEOUTrjrrr"r1r3r.rr(rJrLrVrhr_r]r^rr`rrcrrr?r;r)rr&sIM!NLIJ11
>#'0N0N $;."1H( >

!#GJ	4(l16(-}~';DD8GeG)-bG$G
,=\=r;rcReZdZdZeZdejddddfdZfdZ	xZ
S)HTTPSConnectionz(This class allows communication via SSL.Nr)rrrrcrtt|||||||t|j}||_y)N)r)rrrjrrQ_context)r5rrrrrrrs       r)rjzHTTPSConnection.__init__sB
/41$g2@<E
2
G/?#DMr;ct||jr
|j}n|j}|jj|j||_y)z(Connect to a host on a given (SSL) port.)server_hostnameN)rr.rrrwrap_socketrg)r5rrs  r)r.zHTTPSConnection.connectsQ
GO  "&"3"3"&))

11$))BQ2SDIr;r)r<r=r>__doc__
HTTPS_PORTrrrrjr.rrs@r)rrs12!	$ & > >$($$	$	S	Sr;rceZdZy)rNr<r=r>r?r;r)rrs	r;rceZdZy)rNrr?r;r)rrr;rceZdZy)rNrr?r;r)rrrr;rceZdZdZy)rc"|f|_||_yr)argsr`)r5r`s  r)rjzUnknownProtocol.__init__sH	r;Nr<r=r>rjr?r;r)rrsr;rceZdZy)r	Nrr?r;r)r	r	rr;r	ceZdZy)r
Nrr?r;r)r
r
rr;r
c2eZdZddZdZejZy)rNc0|f|_||_||_yr)rpartialexpected)r5rrs   r)rjzIncompleteRead.__init__sH	 
r;c|jd|jz}nd}d|jjt|j|fzS)Nz, %i more expectedrmz%s(%i bytes read%s))rrr<r1rr<s  r)__repr__zIncompleteRead.__repr__sK==$$t}}4AA$(?(?(+DLL(91(>>	>r;r)r<r=r>rjrr"__str__r?r;r)rrs!>nnGr;rceZdZy)r
Nrr?r;r)r
r
rr;r
ceZdZy)rNrr?r;r)rrrr;rceZdZy)rNrr?r;r)rrrr;rceZdZy)rNrr?r;r)rrrr;rceZdZdZy)rc<|st|}|f|_||_yr)rprr9rs  r)rjzBadStatusLine.__init__s:DE		r;Nrr?r;r)rrsr;rceZdZdZy)rcBtj|dt|fzy)Nz&got more than %d bytes when reading %s)rrjrE)r5	line_types  r)rjzLineTooLong.__init__s"t%M(0)'<&=	>r;Nrr?r;r)rrs>r;rceZdZdZy)rcbtj|dtj|g|i|y)Nrm)rrjConnectionResetError)r5poskws   r)rjzRemoteDisconnected.__init__s*tR(%%d7S7B7r;Nrr?r;r)rrs8r;r)r&)Fremail.parserrO
email.messager:r*rrerr5collections.abcrCurllib.parser__all__rrr_rr\r~globalsupdater+__members__rzphraserrErFcompile	fullmatchrwrnryrtrmrr*r0Messager,rIrUrWBufferedIOBaserrrrrr4ImportError	Exceptionrrrrr	r
rr
rrrrrrrr)vs0r)<module>rs^DL		

!
	

#	,,-#'//"="="D"D"FGQQ[G	6#

#67AA%2::&CDKK%/BJJ/@$A!(2rzz-'@$3E%--''<$.9@)0a2$$aH
n	n	`!&S.S8NN$%	I	
	=			m
	m		M	]	m		/		.		.	M>->
8-}8	_,
HX)		s
HHH&%H&