Files
wg-backend-django/acer-env/lib/python3.10/site-packages/urllib3/__pycache__/response.cpython-310.pyc

259 lines
22 KiB
Plaintext
Raw Normal View History

2022-11-30 15:58:16 +07:00
o
<00>Ԅcv<00>@s<>ddlmZddlZddlZddlZddlZddlmZddlm Z
ddlm Z zzddl ZWn ey<ddlZYnwWn eyIdZYnwddlmZddlmZdd lmZmZdd
lmZmZmZmZmZmZmZmZm Z m!Z!dd l"m#Z#dd l$m%Z%m&Z&e<03>'e(<28>Z)Gd d<0E>de*<2A>Z+Gdd<10>de*<2A>Z,Gdd<12>de*<2A>Z-edur<>Gdd<14>de*<2A>Z.Gdd<16>de*<2A>Z/dd<18>Z0Gdd<1A>dej1<6A>Z2dS)<1B>)<01>absolute_importN)<01>contextmanager)<01>error)<01>timeout<75>)<01>util)<01>HTTPHeaderDict)<02> BaseSSLError<6F> HTTPException)
<EFBFBD>BodyNotHttplibCompatible<6C> DecodeError<6F> HTTPError<6F>IncompleteRead<61>InvalidChunkLength<74> InvalidHeader<65> ProtocolError<6F>ReadTimeoutError<6F>ResponseNotChunked<65>SSLError)<01>six)<02> is_fp_closed<65>is_response_to_headc@<00>$eZdZdd<02>Zdd<04>Zdd<06>ZdS)<08>DeflateDecodercCsd|_d|_t<02><03>|_dS)NT<4E>)<05>
_first_try<EFBFBD>_data<74>zlib<69> decompressobj<62>_obj<62><01>self<6C>r"<00>c/home/infidel/Sync/Project/ocp-wg-backend/acer-env/lib/python3.10/site-packages/urllib3/response.py<70>__init__)szDeflateDecoder.__init__cC<00> t|j|<01>S<00>N<><02>getattrr<00>r!<00>namer"r"r#<00> __getattr__.<00> zDeflateDecoder.__getattr__c Cs<>|s|S|js |j<01>|<01>S|j|7_z|j<01>|<01>}|r#d|_d|_|WStjyId|_t<04>tj <00>|_z |<00>|j<03>Wd|_YSd|_ww)NF)rr<00>
decompressrrrr<00> MAX_WBITS)r!<00>data<74> decompressedr"r"r#r-1s$   <02>zDeflateDecoder.decompressN<73><06>__name__<5F>
__module__<EFBFBD> __qualname__r$r+r-r"r"r"r#r(s rc@seZdZdZdZdZdS)<05>GzipDecoderStaterr<00>N)r2r3r4<00> FIRST_MEMBER<45> OTHER_MEMBERS<52> SWALLOW_DATAr"r"r"r#r5Hsr5c@r)<08> GzipDecodercCst<00>dtj<00>|_tj|_dS)N<>)rrr.rr5r7<00>_stater r"r"r#r$Ps zGzipDecoder.__init__cCr%r&r'r)r"r"r#r+Tr,zGzipDecoder.__getattr__cCs<>t<00>}|jtjks |st|<02>S z
||j<05>|<01>7}Wntjy5|j}tj|_|tj kr4t|<02>YS<00>w|jj
}|s@t|<02>Stj |_t<07> dtj <00>|_q)NTr;) <0A> bytearrayr<r5r9<00>bytesrr-rrr8<00> unused_datarr.)r!r/<00>ret<65>previous_stater"r"r#r-Ws&
 <02><02>zGzipDecoder.decompressNr1r"r"r"r#r:Os r:c@seZdZdd<02>Zdd<04>ZdS)<06> BrotliDecodercCs2t<00><01>|_t|jd<01>r|jj|_dS|jj|_dS)Nr-)<06>brotli<6C> Decompressorr<00>hasattrr-<00>processr r"r"r#r$ss
 zBrotliDecoder.__init__cCst|jd<01>r |j<01><02>SdS)N<>flushr)rErrGr r"r"r#rGzs 
zBrotliDecoder.flushN)r2r3r4r$rGr"r"r"r#rBos rBc@s(eZdZdZdd<03>Zdd<05>Zdd<07>ZdS) <09> MultiDecodera
From RFC7231:
If one or more encodings have been applied to a representation, the
sender that applied the encodings MUST generate a Content-Encoding
header field that lists the content codings in the order in which
they were applied.
cCsdd<02>|<01>d<03>D<00>|_dS)NcSsg|]}t|<01><01><00><01>qSr")<02> _get_decoder<65>strip)<02>.0<EFBFBD>mr"r"r#<00>
<listcomp><3E>sz)MultiDecoder.__init__.<locals>.<listcomp><3E>,)<02>split<69> _decoders)r!<00>modesr"r"r#r$<00>szMultiDecoder.__init__cCs|jd<00><01>S<00>Nr)rPrGr r"r"r#rG<00><00>zMultiDecoder.flushcCst|j<01>D]}|<02>|<01>}q|Sr&)<03>reversedrPr-)r!r/<00>dr"r"r#r-<00>s zMultiDecoder.decompressN)r2r3r4<00>__doc__r$rGr-r"r"r"r#rH<00>s
 rHcCs:d|vrt|<00>S|dkrt<01>Stdur|dkrt<03>St<04>S)NrN<00>gzip<69>br)rHr:rCrBr)<01>moder"r"r#rI<00>srIc@s<>eZdZdZddgZeduredg7Zgd<06>Z           
  dLd d <0C>Zd d<0E>Zdd<10>Z dd<12>Z
e dd<14><00>Z e dd<16><00>Z dd<18>Zdd<1A>Zdd<1C>Zdd<1E>ZeejfZedurdeejf7Zdd <20>Zd!d"<22>Zed#d$<24><00>Zd%d&<26>ZdMd'd(<28>ZdNd*d+<2B>Zed,d-<2D><00>Zd.d/<2F>ZdOd0d1<64>Z d2d3<64>Z!d4d5<64>Z"e d6d7<64><00>Z#d8d9<64>Z$d:d;<3B>Z%d<d=<3D>Z&d>d?<3F>Z'd@dA<64>Z(dBdC<64>Z)dDdE<64>Z*dPdFdG<64>Z+dHdI<64>Z,dJdK<64>Z-dS)Q<> HTTPResponsea<65>
HTTP Response container.
Backwards-compatible with :class:`http.client.HTTPResponse` but the response ``body`` is
loaded and decoded on-demand when the ``data`` property is accessed. This
class is also compatible with the Python standard library's :mod:`io`
module, and can hence be treated as a readable object in the context of that
framework.
Extra parameters for behaviour not present in :class:`http.client.HTTPResponse`:
:param preload_content:
If True, the response's body will be preloaded during construction.
:param decode_content:
If True, will attempt to decode the body based on the
'content-encoding' header.
:param original_response:
When this HTTPResponse wrapper is generated from an :class:`http.client.HTTPResponse`
object, it's convenient to include the original for debug purposes. It's
otherwise unused.
:param retries:
The retries contains the last :class:`~urllib3.util.retry.Retry` that
was used during the request.
:param enforce_content_length:
Enforce content length checking. Body returned by server must match
value of Content-Length header, if present. Otherwise, raise error.
rW<00>deflateNrX)i-i.i/i3i4<00>rTFcCst|t<01>r ||_nt|<02>|_||_||_||_||_||_| |_||_ ||_
d|_ d|_ d|_ | |_d|_| |_||_|rHt|tjtf<02>rH||_ |
|_| |_t|d<02>rV||_ d|_d|_|j<02>dd<05><02><1B>}dd<07>|<12>d<08>D<00>}d |vrvd
|_|<00>|<0F>|_|r<>|j s<>|j|d <0B>|_ dSdSdS) Nr<00>readFztransfer-encodingr\css<00>|]}|<01><00>VqdSr&)rJ)rK<00>encr"r"r#<00> <genexpr>s<02>z(HTTPResponse.__init__.<locals>.<genexpr>rN<00>chunkedT<64><01>decode_content) <20>
isinstancer<00>headers<72>status<75>version<6F>reason<6F>strictrb<00>retries<65>enforce_content_length<74>
auto_close<EFBFBD>_decoder<65>_body<64>_fp<66>_original_response<73>_fp_bytes_read<61>msg<73> _request_urlr<00> string_typesr><00>_pool<6F> _connectionrEr`<00>
chunk_left<EFBFBD>get<65>lowerrO<00> _init_length<74>length_remainingr])r!<00>bodyrdrerfrgrh<00>preload_contentrb<00>original_response<73>pool<6F>
connectionrqrirj<00>request_method<6F> request_urlrk<00>tr_enc<6E> encodingsr"r"r#r$<00>sD


 
<08>zHTTPResponse.__init__cCs|j|jvr |j<02>d<01>SdS)a
Should we redirect and where to?
:returns: Truthy redirect location string if we got a redirect status
code and valid location. ``None`` if redirect status and no
location. ``False`` if not a redirect status code.
<20>locationF)re<00>REDIRECT_STATUSESrdrwr r"r"r#<00>get_redirect_location s  z"HTTPResponse.get_redirect_locationcCs(|jr|jsdS|j<00>|j<01>d|_dSr&)rtru<00> _put_connr r"r"r#<00> release_conns 
zHTTPResponse.release_connc Cs,z|<00><00>WdSttttfyYdSw)z<>
Read and discard any remaining HTTP response data in the response connection.
Unread data in the HTTPResponse connection blocks the connection from being released back to the pool.
N)r]r <00> SocketErrorr r
r r"r"r#<00>
drain_conns
<02>zHTTPResponse.drain_conncCs"|jr|jS|jr|jdd<02>SdS)NT)<01> cache_content)rmrnr]r r"r"r#r/*s
 <04>zHTTPResponse.datacC<00>|jSr&)rur r"r"r#r3szHTTPResponse.connectioncCs
t|j<01>Sr&)rrnr r"r"r#<00>isclosed7s
zHTTPResponse.isclosedcCr<>)z<>
Obtain the number of bytes pulled over the wire so far. May differ from
the amount of content returned by :meth:``urllib3.response.HTTPResponse.read``
if bytes are encoded on the wire (e.g, compressed).
)rpr r"r"r#<00>tell:szHTTPResponse.tellcCs<>|j<00>d<01>}|durD|jrt<03>d<03>dSztdd<05>|<02>d<06>D<00><01>}t|<03>dkr-td|<00><01>|<03> <09>}Wn t
y=d}Ynw|d krDd}zt |j <0C>}Wn t
yVd }Ynw|d
vsjd |kred ksjn|d krld }|S)zM
Set initial length value for Response content if available.
zcontent-lengthNz<4E>Received response with both Content-Length and Transfer-Encoding set. This is expressly forbidden by RFC 7230 sec 3.3.2. Ignoring Content-Length and attempting to process response as Transfer-Encoding: chunked.cSsg|]}t|<01><01>qSr")<01>int)rK<00>valr"r"r#rM\sz-HTTPResponse._init_length.<locals>.<listcomp>rNrz8Content-Length contained multiple unmatching values (%s)r)<02><>i0<00>d<00><><00>HEAD) rdrwr`<00>log<6F>warning<6E>setrO<00>lenr<00>pop<6F>
ValueErrorr<EFBFBD>re)r!r<><00>length<74>lengthsrer"r"r#ryBs: <04> <02><04>  <02> <02>&zHTTPResponse._init_lengthcsv<00>j<00>dd<02><02><02>}<01>jdur5|<01>jvrt|<01><01>_dSd|vr7<72>fdd<06>|<01>d<04>D<00>}t|<02>r9t|<01><01>_dSdSdSdS)z=
Set-up the _decoder attribute if necessary.
<20>content-encodingr\NrNcs"g|] }|<01><00><00>jvr|<01><00><00>qSr")rJ<00>CONTENT_DECODERS)rK<00>er r"r#rM<00>s  <02><06>z.HTTPResponse._init_decoder.<locals>.<listcomp>)rdrwrxrlr<>rIrOr<>)r!<00>content_encodingr<67>r"r r#<00> _init_decodervs


<06><04>zHTTPResponse._init_decoderc
Csn|s|Sz |jr|j<00>|<01>}Wn|jy,}z|j<03>dd<02><02><05>}td||<04><02>d}~ww|r5||<00><07>7}|S)zN
Decode the data passed in and potentially flush the decoder.
r<>r\zEReceived response with content-encoding: %s, but failed to decode it.N)rlr-<00>DECODER_ERROR_CLASSESrdrwrxr <00>_flush_decoder)r!r/rb<00> flush_decoderr<72>r<>r"r"r#<00>_decode<64>s& <04><02><04><08><02> zHTTPResponse._decodecCs$|jr|j<00>d<01>}||j<00><02>SdS)zk
Flushes the decoder. Should only be called if the decoder is actually
being used.
r)rlr-rG)r!<00>bufr"r"r#r<><00>s zHTTPResponse._flush_decoderc
cs <00>d}zkzdVWn>tyt|jdd<03><03>ty3}zdt|<02>vr(t|<02><01>t|jdd<03><03>d}~wttfyG}ztd||<02><02>d}~wwd}W|s]|j rU|j <09>
<EFBFBD>|j r]|j <0B>
<EFBFBD>|j rk|j <09> <0C>rm|<00> <0A>dSdSdS|s<>|j ry|j <09>
<EFBFBD>|j r<>|j <0B>
<EFBFBD>|j r<>|j <09> <0C>r<>|<00> <0A>www)z<>
Catch low-level python exceptions, instead re-raising urllib3
variants, so that low-level exceptions are not leaked in the
high-level api.
On exit, release the connection back to the pool.
FNzRead timed out.zread operation timed outzConnection broken: %rT)<0E> SocketTimeoutrrtr <00>strrr
r<>rro<00>closerur<>r<>)r!<00>
clean_exitr<EFBFBD>r"r"r#<00>_error_catcher<65>sB<02> 
  <08><08><02>

 <08><04>


<04>zHTTPResponse._error_catchercCs<>|jsJ<00>d}|r ||ks|jr]|j|kr]tjs]tjs tjdkr]t<07><08>}d}|dus.|dkrY|dur<t ||<04>}||8}n|}|j<00>
|<05>}|sK |<03> <0C>S|<03> |<06>~|dus.|dks.|<03> <0C>S|durg|j<00>
|<01>S|j<00>
<EFBFBD>S)a_
Read a response with the thought that reading the number of bytes
larger than can fit in a 32-bit int at a time via SSL in some
known cases leads to an overflow error that has to be prevented
if `amt` or `self.length_remaining` indicate that a problem may
happen.
The known cases:
* 3.8 <= CPython < 3.9.7 because of a bug
https://github.com/urllib3/urllib3/issues/2513#issuecomment-1152559900.
* urllib3 injected with pyOpenSSL-backed SSL-support.
* CPython < 3.10 only when `amt` does not fit 32-bit int.
i<><69><EFBFBD>)<02><00>
iNr) rnrzr<00>IS_SECURETRANSPORT<52> IS_PYOPENSSL<53>sys<79> version_info<66>io<69>BytesIO<49>minr]<00>write<74>getvalue)r!<00>amt<6D> c_int_max<61>buffer<65> max_chunk_amt<6D> chunk_amtr/r"r"r#<00>_fp_read<61>s@
<02><02><02><02><02><02><02>

 
<EFBFBD><10> zHTTPResponse._fp_readcCs|<00><00>|dur |j}|jdurdSd}t|jdd<02>}|<00><04><00>6|s'|<00>|<01>nd}|dur0d}nd}|dkrN|sN|j<02><06>d}|jrN|jdvrNt |j
|j<08><02>Wd<00>n1sXwY|r<>|j
t |<06>7_
|jdurv|jt |<06>8_|<00> |||<04>}|r<>||_ |S)aT
Similar to :meth:`http.client.HTTPResponse.read`, but with two additional
parameters: ``decode_content`` and ``cache_content``.
:param amt:
How much of the content to read. If specified, caching is skipped
because it doesn't make sense to cache partial content as the full
response.
:param decode_content:
If True, will attempt to decode the body based on the
'content-encoding' header.
:param cache_content:
If True, will save the returned data such that the same result is
returned despite of the state of the underlying file object. This
is useful if you want the ``.data`` property to continue working
after having ``.read()`` the file object. (Overridden if ``amt`` is
set.)
NF<4E>closedrTr)rN)r<>rbrnr(r<>r<>r<>rjrzrrpr<>r<>rm)r!r<>rbr<>r<><00> fp_closedr/r"r"r#r]s<

<02><02>
 <02><1C>
zHTTPResponse.read<61>ccsb<00>|jr|<00><01>r|j||d<01>D]}|VqdSt|j<04>s/|j||d<02>}|r(|Vt|j<04>rdSdS)a_
A generator wrapper for the read() method. A call will block until
``amt`` bytes have been read from the connection or until the
connection is closed.
:param amt:
How much of the content to read. The generator will return up to
much data per iteration, but may return less. This is particularly
likely when using compressed data. However, the empty string will
never be returned.
:param decode_content:
If True, will attempt to decode the body based on the
'content-encoding' header.
ra)r<>rbN)r`<00>supports_chunked_reads<64> read_chunkedrrnr])r!r<>rb<00>liner/r"r"r#<00>stream^s<02><04>
<12>zHTTPResponse.streamc
Ksb|j}t|t<02>stjrt<02>|<03>}nt|<03><06><00>}t|dd<02>}|d|||j|j |j
||d<03>|<02><01>}|S)a
Given an :class:`http.client.HTTPResponse` instance ``r``, return a
corresponding :class:`urllib3.response.HTTPResponse` object.
Remaining parameters are passed to the HTTPResponse constructor, along
with ``original_response=r``.
rhr)r{rdrerfrgrhr}Nr") rqrcrr<00>PY2<59> from_httplib<69>itemsr(rerfrg)<06> ResponseCls<6C>r<> response_kwrdrh<00>respr"r"r#r<>xs$
   <04><06>
zHTTPResponse.from_httplibcCr<>r&<00>rdr r"r"r#<00>
getheaders<EFBFBD><00>zHTTPResponse.getheaderscCs|j<00>||<02>Sr&)rdrw)r!r*<00>defaultr"r"r#<00> getheader<65>rSzHTTPResponse.getheadercCr<>r&r<>r r"r"r#<00>info<66>r<>zHTTPResponse.infocCs:|js|j<01><02>|jr|j<03><02>|jstj<06>|<00>dSdSr&)r<>rnr<>rurkr<><00>IOBaser r"r"r#r<><00>s

<04>zHTTPResponse.closecCsP|js
tjj<03>|<00>S|jdurdSt|jd<02>r|j<05><07>St|jd<03>r&|jjSdS)NTr<54>r<>)rkr<>r<>r<><00>__get__rnrEr<>r r"r"r#r<><00>s
 
 zHTTPResponse.closedcCs0|jdur td<01><01>t|jd<02>r|j<00><03>Std<03><01>)Nz-HTTPResponse has no file to get a fileno from<6F>filenozOThe file-like object this HTTPResponse is wrapped around has no file descriptor)rn<00>IOErrorrEr<>r r"r"r#r<><00>s
 
<04>zHTTPResponse.filenocCs:|jdurt|jd<01>rt|jdd<03>s|j<00><03>SdSdSdS)NrGr<>F)rnrEr(rGr r"r"r#rG<00>s<02>
<02> <02>
 <0C>zHTTPResponse.flushcCsdS)NTr"r r"r"r#<00>readable<6C>szHTTPResponse.readablecCs6|<00>t|<01><01>}t|<02>dkrdS||dt|<02><01><t|<02>SrR)r]r<>)r!<00>b<>tempr"r"r#<00>readinto<74>s
 zHTTPResponse.readintocCs t|jd<01>S)a
Checks if the underlying file-like object looks like a
:class:`http.client.HTTPResponse` object. We do this by testing for
the fp attribute. If it is present we assume it returns raw chunks as
processed by read_chunked().
<20>fp)rErnr r"r"r#r<><00>s z#HTTPResponse.supports_chunked_readscCs^|jdurdS|jj<02><03>}|<01>dd<02>d}z t|d<04>|_WdSty.|<00><07>t||<01><02>w)N<>;rrr;) rvrnr<><00>readlinerOr<>r<>r<>r)r!r<>r"r"r#<00>_update_chunk_length<74>s
  
<02>z!HTTPResponse._update_chunk_lengthcCs<>d}|dur|j<00>|j<02>}|}|j<00>d<01>d|_|S||jkr/|j<00>|<01>}|j||_|}|S||jkrG|j<00>|<01>}|j<00>d<01>d|_|}|S|j<00>|j<02>}|j<00>d<01>d|_|S)Nr6)rn<00>
_safe_readrv)r!r<><00>returned_chunk<6E>chunk<6E>valuer"r"r#<00> _handle_chunk<6E>s, 
<EFBFBD>  
<EFBFBD>  <0E> zHTTPResponse._handle_chunkccs2<00>|<00><00>|js td<01><01>|<00><03>std<02><01>|<00><05><00>w|jr/t|j<06>r/|j<06><08> Wd<00>dS|j j
dur> Wd<00>dS |<00> <0B>|j dkrIn|<00> |<01>}|j||dd<07>}|r[|Vq?|rg|<00><0F>}|rg|V |j j
<EFBFBD><10>}|sqn|dkrvnqh|jr<>|j<06><08>Wd<00>dSWd<00>dS1s<>wYdS) a<>
Similar to :meth:`HTTPResponse.read`, but with an additional
parameter: ``decode_content``.
:param amt:
How much of the content to read. If specified, caching is skipped
because it doesn't make sense to cache partial content as the full
response.
:param decode_content:
If True, will attempt to decode the body based on the
'content-encoding' header.
zHResponse is not chunked. Header 'transfer-encoding: chunked' is missing.zkBody should be http.client.HTTPResponse like. It should have have an fp attribute which returns raw chunks.NTrF)rbr<>s
)r<>r`rr<>r r<>rorr<>rnr<>r<>rvr<>r<>r<>r<>)r!r<>rbr<><00>decodedr<64>r"r"r#r<>sZ<02><04><04>

<10> <10> 

<06><02>  <02> <0E>("<22>zHTTPResponse.read_chunkedcCs*|jdurt|jj<02>r|jjdjS|jS)z<>
Returns the URL that was the source of this response.
If the request that generated this response redirected, this method
will return the final redirect location.
N<><4E><EFBFBD><EFBFBD><EFBFBD>)rir<><00>history<72>redirect_locationrrr r"r"r#<00>geturlNszHTTPResponse.geturlccs<><00>g}|jdd<02>D]7}d|vr;|<02>d<03>}d<04>|<01>|ddV|dd<07>D]}|dVq&|dr8|dg}q g}q |<01>|<02>q |rKd<04>|<01>VdSdS)NTra<00>
rrrr<>)r<>rO<00>join<69>append)r!r<>r<><00>xr"r"r#<00>__iter__Ys<02>
   <04>zHTTPResponse.__iter__)r\NrrNrTTNNNNNFNNT)NNF)r<>Nr&)NN).r2r3r4rVr<>rCr<>r$r<>r<>r<><00>propertyr/rr<>r<>ryr<>r<>rrr<>r<>r<>rr<>r<>r]r<><00> classmethodr<64>r<>r<>r<>r<>r<>r<>rGr<>r<>r<>r<>r<>r<>r<>r<>r"r"r"r#rZ<00>s~ 

<EFBFBD>C 

4
 
7
0
H


    
F rZ)3<>
__future__rr<><00>loggingr<67>r<00>
contextlibr<00>socketrr<>rr<><00>
brotlicffirC<00> ImportErrorr\r<00> _collectionsrrr r
<00>
exceptionsr r r rrrrrrr<00>packagesr<00> util.responserr<00> getLoggerr2r<><00>objectrr5r:rBrHrIr<>rZr"r"r"r#<00><module>sB       <02><04> <02>  0