Viewing File: /opt/alt/python35/lib64/python3.5/http/__pycache__/client.cpython-35.pyc



Yf@sNdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZdddddd	d
ddd
ddddddddgZdZ
dZdZdZdZdZejejjddejjjDZdZdZd Zejd!jZejd"jZ ejd#Z!d$d%d&hZ"d'd(d)Z#Gd*d+d+ej$j%Z&e&d,d-Z'Gd.ddej(Z)Gd/ddZ*yddl+Z+Wne,k
rYn$XGd0d1d1e*Z-ej.d1Gd2dde/Z0Gd3dde0Z1Gd4dde0Z2Gd5dde0Z3Gd6d	d	e0Z4Gd7d
d
e0Z5Gd8dde0Z6Gd9d
d
e0Z7Gd:dde7Z8Gd;dde7Z9Gd<dde7Z:Gd=dde0Z;Gd>dde0Z<Gd?dde=e;Z>e0Z?dS)@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	responsesPiZUNKNOWNZIdlezRequest-startedzRequest-sentcCsi|]}|j|qS)phrase).0vrr0/opt/alt/python35/lib64/python3.5/http/client.py
<dictcomp>ks	riids[^:\s][^:\r\n]*s\n(?![ \t])|\r(?![ \t\n])z[- ]ZPATCHZPOSTZPUTdatacCsy|jdSWnotk
r}zOt|j|j|j|jd|j||j|j|fdWYdd}~XnXdS)z<Call data.encode("latin-1") but show a better error message.zlatin-1z`%s (%.20r) is not valid Latin-1. Use %s.encode('utf-8') if you want to send it encoded in UTF-8.N)encodeUnicodeEncodeErrorencodingobjectstartendtitle)rnameerrrrr_encodesr'c@seZdZddZdS)HTTPMessagecCs|jd}t|}g}d}xh|jD]Z}|d|j|kr`d}n|ddjs|d}|r5|j|q5W|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%nZlstZhitlinerrrgetallmatchingheaderss
	z!HTTPMessage.getallmatchingheadersN)__name__
__module____qualname__r3rrrrr(sr(cCsg}xq|jtd}t|tkr:td|j|t|tkritdt|d	kr	Pq	Wdj|jd}t	j
jd|j|S)
aGParses only RFC2822 headers from a file pointer.

    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*zheader linezgot more than %d headers

z
iso-8859-1_class)r7r8r9)
readline_MAXLINEr,rr/_MAXHEADERSrjoindecodeemailparserZParserZparsestr)fpr:headersr2Zhstringrrr
parse_headerss

rDcseZdZdddddZddZddZd	d
ZddZfd
dZfddZ	ddZ
ddZdddZddZ
ddZddZddZdd Zd!d"Zd#d$Zd%d&Zd@d(d)ZdAd*d+ZdBfd,d-Zd.d/Zd0d1Zd2d3Zdd4d5Zd6d7Zd8d9Zd:d;Zd<d=Zd>d?Z S)CrrNcCsw|jd|_||_||_d|_|_t|_t|_t|_	t|_
t|_t|_t|_
dS)Nrb)makefilerB
debuglevel_methodrCmsg_UNKNOWNversionstatusreasonchunked
chunk_leftlength
will_close)r0sockrGmethodurlrrr__init__s								zHTTPResponse.__init__cCsit|jjtdd}t|tkr=td|jdkr_tdt||sqt	dy|j
dd\}}}WnOtk
ry"|j
dd\}}d}Wntk
rd}YnXYnX|jd	s|j
t|y4t|}|d
ks.|dkr:t|Wntk
r[t|YnX|||fS)Nr*z
iso-8859-1zstatus linerzreply:z-Remote end closed connection without responsezHTTP/ri)strrBr;r<r,rrGprintreprrsplit
ValueError
startswith_close_connrint)r0r2rKrLrMrrr_read_statuss2




zHTTPResponse._read_statuscCs|jdk	rdSx|j\}}}|tkr8Pxg|jjtd}t|tkrotd|j}|sP|j	dkr;t
d|q;WqW||_|_|j|_
|dkrd|_n'|jdrd	|_nt|t|j|_|_|j	dkrSx$|jD]}t
d|d
dq6W|jjd}|r|jd
krd|_d|_n	d|_|j|_d|_|jjd}|jjd}|r3|jr3yt||_Wntk
rd|_Yq<X|jdkr<d|_n	d|_|tks|tksd|kokdkns|jdkrd|_|jr|jr|jdkrd|_dS)Nr*zheader linerzheader:HTTP/1.0HTTP/0.9
zHTTP/1.r# ztransfer-encodingrNTFzcontent-lengthrHEAD)rarb)rCr`ZCONTINUErBr;r<r,rstriprGrYcoderLrMrKr]rrDrIgetr+rNrO_check_closerQrPr_r\Z
NO_CONTENTZNOT_MODIFIEDrH)r0rKrLrMskiphdrZtr_encrPrrrbegin,sf			
		

zHTTPResponse.begincCs|jjd}|jdkrS|jjd}|rOd|jkrOdSdS|jjdridS|rd|jkrdS|jjd}|rd|jkrdSdS)NZ
connectionrdcloseTFz
keep-alivezproxy-connection)rCrjrKr+)r0ZconnZpconnrrrrk|szHTTPResponse._check_closecCs |j}d|_|jdS)N)rBro)r0rBrrrr^s		zHTTPResponse._close_connc
s,ztjWd|jr'|jXdS)N)superrorBr^)r0)	__class__rrros	zHTTPResponse.closecs'tj|jr#|jjdS)N)rpflushrB)r0)rqrrrrs
	zHTTPResponse.flushcCsdS)NTr)r0rrrreadableszHTTPResponse.readablecCs
|jdkS)z!True if the connection is closed.N)rB)r0rrrisclosedszHTTPResponse.isclosedcCs|jdkrdS|jdkr0|jdS|dk	rqt|}|j|}t|d|jS|jr|jS|j	dkr|jj
}nAy|j|j	}Wntk
r|jYnXd|_	|j|SdS)Nr9rgr)
rBrHr^	bytearrayreadinto
memoryviewtobytesrN_readall_chunkedrPread
_safe_readr
)r0amtbr1srrrrzs*
	


	
zHTTPResponse.readcCs|jdkrdS|jdkr0|jdS|jrF|j|S|jdk	rt||jkrt|d|j}|jj|}|r|r|jn1|jdk	r|j|8_|js|j|S)Nrrg)	rBrHr^rN_readinto_chunkedrPr,rwrv)r0r}r1rrrrvs$
	


	
zHTTPResponse.readintocCs|jjtd}t|tkr4td|jd}|dkr_|d|}yt|dSWntk
r|jYnXdS)Nr*z
chunk size;r)	rBr;r<r,rfindr_r\r^)r0r2irrr_read_next_chunk_sizes

z"HTTPResponse._read_next_chunk_sizecCsSxL|jjtd}t|tkr7td|s>P|dkrPqWdS)Nr*ztrailer line

r9)rrr9)rBr;r<r,r)r0r2rrr_read_and_discard_trailer
sz&HTTPResponse._read_and_discard_trailercCs|j}|s|dk	r(|jdy|j}Wntk
rXtdYnX|dkr|j|jd}||_|S)NrVr9r)rOr{rr\r
rr^)r0rOrrr_get_chunk_lefts	



	zHTTPResponse._get_chunk_leftcCs|jtkstg}yPx<|j}|dkr:P|j|j|d|_q!Wdj|SWn'tk
rtdj|YnXdS)Nrr9)	rNrJAssertionErrorrr/r{rOr>r
)r0valuerOrrrry3s

zHTTPResponse._readall_chunkedcCs|jtkstd}t|}yx|j}|dkrI|St||kr|j|}|||_||S|d|}|j|}||d}||7}d|_q-WWn.tk
rtt	|d|YnXdS)Nr)
rNrJrrwrr,_safe_readintorOr
bytes)r0r}total_bytesmvbrOr1temp_mvbrrrrAs&


zHTTPResponse._readinto_chunkedcCs|g}xf|dkrn|jjt|t}|sNtdj|||j||t|8}q	Wdj|S)aVRead the number of bytes requested, compensating for partial reads.

        Normally, we have a blocking socket, but a read() can be interrupted
        by a signal (resulting in a partial read).

        Note that we cannot distinguish between EOF and an interrupt when zero
        bytes have been read. IncompleteRead() will be raised in this
        situation.

        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.
        rr9)rBrzmin	MAXAMOUNTr
r>r/r,)r0r|r~chunkrrrr{Ys
zHTTPResponse._safe_readcCsd}t|}x|t|krtt|kr^|dt}|jj|}n|jj|}|stt|d|t|||d}||7}qW|S)z2Same as _safe_read, but for reading into a buffer.rN)rwr,rrBrvr
r)r0r}rrrr1rrrrps%zHTTPResponse._safe_readintor*cCs|jdks|jdkr"dS|jr8|j|S|jdk	rk|dksb||jkrk|j}y|jj|}Wn3tk
r|dkr|jjd}YnX|r|r|jn$|jdk	r|jt|8_|S)zvRead with at most one underlying system call.  If at least one
        byte is buffered, return that instead.
        Nrgr9rrii@)	rBrHrN_read1_chunkedrPread1r\r^r,)r0r1resultrrrrs"	
*	


zHTTPResponse.read1cCsH|jdks|jdkr"dS|jr8|j|S|jj|S)Nrgr9)rBrHrN
_peek_chunkedpeek)r0r1rrrrs
	
zHTTPResponse.peekcs|jdks|jdkr"dS|jr;tj|S|jdk	rn|dkse||jkrn|j}|jj|}|r|r|jn$|jdk	r|jt|8_|S)Nrgr9r)rBrHrNrpr;rPr^r,)r0limitr)rqrrr;s	*	

zHTTPResponse.readlinecCs|j}|dks$|dkr(dSd|ko?|knsJ|}|jj|}|jt|8_|std|S)Nrr9)rrBrrOr,r
)r0r1rOrzrrrrszHTTPResponse._read1_chunkedcCsSy|j}Wntk
r(dSYnX|dkr9dS|jj|d|S)Nr9)rr
rBr)r0r1rOrrrrs
	zHTTPResponse._peek_chunkedcCs
|jjS)N)rBfileno)r0rrrrszHTTPResponse.filenocCsd|jdkrt|jj|p-|}t|tsOt|drS|Sdj|SdS)N__iter__z, )rCrZget_all
isinstancerXhasattrr>)r0r%defaultrCrrr	getheaders	zHTTPResponse.getheadercCs+|jdkrtt|jjS)z&Return list of (header, value) tuples.N)rCrlistitems)r0rrr
getheaderss	zHTTPResponse.getheaderscCs|S)Nr)r0rrrrszHTTPResponse.__iter__cCs|jS)N)rC)r0rrrinfoszHTTPResponse.infocCs|jS)N)rT)r0rrrgeturlszHTTPResponse.geturlcCs|jS)N)rL)r0rrrgetcodeszHTTPResponse.getcoderr)!r4r5r6rUr`rnrkr^rorrrsrtrzrvrrrryrr{rrrr;rrrrrrrrrrr)rqrrs<	!P
 	
	c@s<eZdZdZdZeZeZdZ	dZ
dejdddZ
dddd	Zd
dZdd
ZddZddZddZddZddZdddZddddZddZdd Zd!d"Zdd#d$Zdid%d&Zd'd(Zd)d*Zd+d,ZdS)-rrdzHTTP/1.1r*rNcCs||_||_d|_g|_d|_t|_d|_d|_d|_	i|_
|j||\|_|_
tj|_dS)N)timeoutsource_addressrR_buffer_HTTPConnection__response_CS_IDLE_HTTPConnection__staterH_tunnel_host_tunnel_port_tunnel_headers
_get_hostporthostportsocketZcreate_connection_create_connection)r0rrrrrrrrUs										zHTTPConnection.__init__cCsV|jrtd|j||\|_|_|rE||_n
|jjdS)aDSet up host and port for HTTP CONNECT tunnelling.

        In a connection that uses HTTP CONNECT tunneling, 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 HTML connection has been
        established.

        The headers argument should be a mapping of extra HTTP headers to send
        with the CONNECT request.
        z.Can't set up tunnel for established connectionN)rRRuntimeErrorrrrrclear)r0rrrCrrr
set_tunnel
s	zHTTPConnection.set_tunnelcCs	|dkr|jd}|jd}||kryt||dd}WnVtk
r||dddkr|j}ntd||ddYnX|d|}n	|j}|r|ddkr|ddkr|dd	}||fS)
Nr)]r*rWznonnumeric port: '%s'r[rr)rfindr_r\default_portr)r0rrrjrrrr"s
#	&zHTTPConnection._get_hostportcCs
||_dS)N)rG)r0levelrrrset_debuglevel6szHTTPConnection.set_debuglevelcCshd|j|jf}|jd}|j|xI|jjD]8\}}d||f}|jd}|j|qBW|jd|j|jd|j}|j	\}}	}
|	t
jjkr|j
td|	|
jfxn|jjtd}t|tkr*td	|s1P|dkr>P|jdkrtd
|jqWdS)NzCONNECT %s:%d HTTP/1.0
asciiz%s: %s
zlatin-1
rSzTunnel connection failed: %d %sr*zheader line
r9rzheader:)rrr9)rrrsendrrresponse_classrRrHr`http
HTTPStatusZOKroOSErrorrhrBr;r<r,rrGrYr?)r0Zconnect_strZ
connect_bytesheaderrZ
header_strZheader_bytesresponserKrimessager2rrr_tunnel9s2	



	zHTTPConnection._tunnelcCs]|j|j|jf|j|j|_|jjtjtj	d|j
rY|jdS)z3Connect to the host and port specified in __init__.r*N)rrrrrrRZ
setsockoptrZIPPROTO_TCPZTCP_NODELAYrr)r0rrrconnectXs
$	zHTTPConnection.connectcCsYt|_z&|j}|r.d|_|jWd|j}|rTd|_|jXdS)z(Close the connection to the HTTP server.N)rrrRror)r0rRrrrrroas					zHTTPConnection.closecCs|jdkr.|jr%|jn	t|jdkrPtdt|d}t|dr|jdkr~tdd}y
|j}Wnt	k
rYn,Xd|krd	}|jdkrtd
x?|j
|}|sP|r|jd}|jj|qWdSy|jj|Wn^t
k
rt|tjrqx7|D]}|jj|qTWnt
dt|YnXdS)
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:i rzzsendIng a read()ableFr}Tzencoding file using iso-8859-1z
iso-8859-1z9data should be a bytes-like object or an iterable, got %r)rR	auto_openrrrGrYrZrmodeAttributeErrorrzrZsendall	TypeErrorrcollectionsIterabletype)r0rZ	blocksizerrZ	datablockdrrrrosF	
	





zHTTPConnection.sendcCs|jj|dS)zuAdd a line of output to the current request buffer.

        Assumes that the line does *not* end with \r\n.
        N)rr/)r0r~rrr_outputszHTTPConnection._outputcCs\|jjddj|j}|jdd=|j||dk	rX|j|dS)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.
        r9s
N)r9r9)rextendr>r)r0message_bodyrIrrr_send_outputs
zHTTPConnection._send_outputFc
Cs |jr!|jjr!d|_|jtkr<t|_nt|j||_|p]d}|j|d|||jf}|j	|j
||jdkr|sd}|jdrt
|\}}}}}|r.y|jd}Wn!tk
r|jd}YnX|jd	|n|jrL|j}	|j}
n|j}	|j}
y|	jd}Wn!tk
r|	jd}YnX|	jd
dkrd|d
}|
|jkr|jd	|n)|jd}|jd	d||
f|s|jddndS)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/z%s %s %srdrWrrZidnaZHostr)r[]z%s:%szAccept-EncodingZidentity)rrtrr_CS_REQ_STARTEDr
rH_validate_path
_http_vsn_strr_encode_request	_http_vsnr]rrr	putheaderrrrrrrr?)r0rSrT	skip_hostskip_accept_encodingrequestZnetlocZnilZ
netloc_encrrZhost_encrrr
putrequestsN		

				

zHTTPConnection.putrequestcCs
|jdS)Nr)r)r0rrrrr1szHTTPConnection._encode_requestcCsCtj|}|r?djd|jt}t|dS)zValidate a url for putrequest.zJURL can't contain control characters. {url!r} (found at least {matched!r})ZmatchedN)!_contains_disallowed_url_pchar_researchformatgrouplocalsr)r0rTmatchrIrrrr5s
	zHTTPConnection._validate_pathcGs |jtkrtt|dr6|jd}t|sUtd|ft|}xt|D]\}}t|dr|jd||<n(t	|t
rt|jd||<t||rntd||fqnWdj
|}|d|}|j|dS)	zkSend a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        rrzInvalid header name %rzlatin-1zInvalid header value %rs
	s: N)rrrrr_is_legal_header_namer\r	enumeraterr_rX_is_illegal_header_valuer>r)r0rvaluesrZ	one_valuerrrrr@s"	zHTTPConnection.putheadercCs5|jtkrt|_n	t|j|dS)aIndicate 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.  The message body will be sent in the same packet as the
        message headers if it is a string, otherwise it is sent as a separate
        packet.
        N)rr_CS_REQ_SENTrr)r0rrrr
endheaders\s		zHTTPConnection.endheaderscCs|j||||dS)z&Send a complete request to the server.N)
_send_request)r0rSrTbodyrCrrrrkszHTTPConnection.requestcCsd}|jtk}|dkr3|r3d}n|dk	rytt|}Wnhtk
ry"ttj|jj}Wn1t	t
fk
r|jdkrtdYnXYnX|dk	r|j
d|dS)N0rz
Cannot stat!!zContent-Length)upper_METHODS_EXPECTING_BODYrXr,rosfstatrst_sizerrrGrYr)r0rrSZthelenZmethod_expects_bodyrrr_set_content_lengthos	
"z"HTTPConnection._set_content_lengthc	Cstjdd|D}i}d|kr8d|d<d|krNd|d<|j|||d|kr}|j||x*|jD]\}}|j||qWt|trt|d	}|j	|dS)
NcSsg|]}|jqSr)r+)rkrrr
<listcomp>s	z0HTTPConnection._send_request.<locals>.<listcomp>rr*rzaccept-encodingrzcontent-lengthr)
dictfromkeysrrrrrrXr'r)	r0rSrTrrCZheader_namesZskipsrmrrrrrs

zHTTPConnection._send_requestcCs'|jr!|jjr!d|_|jtks9|jrHt|j|jdkr{|j|j|jd|j}n|j|jd|j}yuy|j	Wnt
k
r|jYnX|jt
kstt|_|jr|jn	||_|SWn|jYnXdS)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.
        NrrS)rrtrrrrGrrRrHrnConnectionErrorrorQrJrr)r0rrrrgetresponses.	

		
	
zHTTPConnection.getresponse) r4r5r6rrrr	HTTP_PORTrrrGr_GLOBAL_DEFAULT_TIMEOUTrUrrrrrrorrrrrrrrrrrrrrrrrs6		0|cs^eZdZdZeZdddejdddddfddZfddZ	S)	HTTPSConnectionz(This class allows communication via SSL.Ncontextcheck_hostnamec
stt|j||||||_||_|dkrItj}|jtjk}	|dkrp|j	}|r|	rt
d|s|r|j||||_||_
dS)NzMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED)rprrUkey_file	cert_filesslZ_create_default_https_contextZverify_modeZ	CERT_NONErr\Zload_cert_chain_context_check_hostname)
r0rrrrrrrrZwill_verify)rqrrrUs			
	zHTTPSConnection.__init__cstj|jr"|j}n	|j}|jj|jd||_|jjr|jryt	j
|jj|Wn5tk
r|jj
tj|jjYnXdS)z(Connect to a host on a given (SSL) port.server_hostnameN)rprrrrZwrap_socketrRrrrZmatch_hostnameZgetpeercert	ExceptionZshutdownrZ	SHUT_RDWRro)r0r	)rqrrrs
		

zHTTPSConnection.connect)
r4r5r6__doc__
HTTPS_PORTrrrrUrrr)rqrrs	rc@seZdZdS)rN)r4r5r6rrrrrsc@seZdZdS)rN)r4r5r6rrrrrsc@seZdZdS)rN)r4r5r6rrrrrsc@seZdZddZdS)rcCs|f|_||_dS)N)argsrK)r0rKrrrrUszUnknownProtocol.__init__N)r4r5r6rUrrrrrsc@seZdZdS)rN)r4r5r6rrrrr"sc@seZdZdS)r	N)r4r5r6rrrrr	%sc@s7eZdZdddZddZddZdS)r
NcCs"|f|_||_||_dS)N)r
partialexpected)r0rrrrrrU)s	zIncompleteRead.__init__cCsE|jdk	rd|j}nd}d|jjt|j|fS)Nz, %i more expectedrWz%s(%i bytes read%s))rrqr4r,r)r0errr__repr__-s
zIncompleteRead.__repr__cCs
t|S)N)rZ)r0rrr__str__4szIncompleteRead.__str__)r4r5r6rUrrrrrrr
(sc@seZdZdS)rN)r4r5r6rrrrr7sc@seZdZdS)r
N)r4r5r6rrrrr
:sc@seZdZdS)rN)r4r5r6rrrrr=sc@seZdZdS)rN)r4r5r6rrrrr@sc@seZdZddZdS)rcCs+|st|}|f|_||_dS)N)rZr
r2)r0r2rrrrUDszBadStatusLine.__init__N)r4r5r6rUrrrrrCsc@seZdZddZdS)rcCstj|dt|fdS)Nz&got more than %d bytes when reading %s)rrUr<)r0Z	line_typerrrrUKszLineTooLong.__init__N)r4r5r6rUrrrrrJsc@seZdZddZdS)rcOs'tj|dtj|||dS)NrW)rrUConnectionResetError)r0poskwrrrrUPszRemoteDisconnected.__init__N)r4r5r6rUrrrrrOs)@rZemail.parserr@Z
email.messageriorrerrZurllib.parser__all__rrrJrrrglobalsupdaterZ__members__rrrr<r=compile	fullmatchrrrrrr'rZMessager(rDBufferedIOBaserrrImportErrorrr/r
rrrrrr	r
rr
rrrrrrrrrrr<module>Esx				
0

Back to Directory File Manager