/usr/lib/python3.9/site-packages/urllib3/__pycache__
NameSizeModeActions
connection.cpython-39.opt-1.pyc133270644editdlrm
connection.cpython-39.pyc133270644editdlrm
connectionpool.cpython-39.opt-1.pyc246710644editdlrm
connectionpool.cpython-39.pyc246710644editdlrm
exceptions.cpython-39.opt-1.pyc115980644editdlrm
exceptions.cpython-39.pyc115980644editdlrm
fields.cpython-39.opt-1.pyc81130644editdlrm
fields.cpython-39.pyc81130644editdlrm
filepost.cpython-39.opt-1.pyc27140644editdlrm
filepost.cpython-39.pyc27140644editdlrm
poolmanager.cpython-39.opt-1.pyc152330644editdlrm
poolmanager.cpython-39.pyc152330644editdlrm
request.cpython-39.opt-1.pyc55770644editdlrm
request.cpython-39.pyc55770644editdlrm
response.cpython-39.opt-1.pyc259890644editdlrm
response.cpython-39.pyc259890644editdlrm
_collections.cpython-39.opt-1.pyc112270644editdlrm
_collections.cpython-39.pyc112270644editdlrm
_version.cpython-39.opt-1.pyc1650644editdlrm
_version.cpython-39.pyc1650644editdlrm
__init__.cpython-39.opt-1.pyc21410644editdlrm
__init__.cpython-39.pyc21410644editdlrm
Edit: /usr/lib/python3.9/site-packages/urllib3/__pycache__/response.cpython-39.pyc (25989B)
a s   ÿÿüzDeflateDecoder.decompresscCst|jƒpt|jjƒo|j Sr%)Úboolrrr.rr r"r"r#Úhas_unconsumed_tailZs ÿz"DeflateDecoder.has_unconsumed_tailN)r+©Ú__name__Ú __module__Ú __qualname__r$r*r/Úpropertyr3r"r"r"r#r&s  *rc@seZdZdZdZdZdS)ÚGzipDecoderStaterréN)r5r6r7Ú FIRST_MEMBERÚ OTHER_MEMBERSÚ SWALLOW_DATAr"r"r"r#r9asr9c@s2eZdZdd„Zdd„Zd dd„Zedd „ƒZd S) Ú GzipDecodercCs$t dtj¡|_tj|_d|_dS)Nér)rrr0rr9r;Ú_stateÚ_unconsumed_tailr r"r"r#r$iszGzipDecoder.__init__cCs t|j|ƒSr%r&r(r"r"r#r*nszGzipDecoder.__getattr__r+cCs tƒ}|jtjkrt|ƒS|dkr4|j|7_dS|j|}|sR|jjrRt|ƒSz&||jj|t |t |ƒdƒd�7}Wn@t j y¸|j}tj|_d|_|tj kr²t|ƒYS‚Yn0|jjpÈ|jj|_}|dkrèt |ƒ|krè�q|sôt|ƒS|jjrRtj |_t  dt j¡|_qRt|ƒS)Nrrr,r?)Ú bytearrayr@r9r=ÚbytesrArÚeofr/ÚmaxÚlenrrr<r.Ú unused_datarr0)r!r1r-ÚretZprevious_stater"r"r#r/qs<   ÿ   ÿzGzipDecoder.decompresscCs t|jƒSr%)r2rAr r"r"r#r3£szGzipDecoder.has_unconsumed_tailN)r+r4r"r"r"r#r>hs  2r>c@s<eZdZdd„Zd dd„Zddd„Zedd „ƒZd d „Zd S)Ú BrotliDecodercCs0t ¡|_t|jdƒr"|jj|_n |jj|_dS)Nr/)ÚbrotliZ DecompressorrÚhasattrr/Ú _decompressZprocessr r"r"r#r$®s   zBrotliDecoder.__init__r+cCs tƒ‚dSr%)ÚNotImplementedError)r!r1Úoutput_buffer_limitr"r"r#rL¶szBrotliDecoder._decompresscCsVz(|dkr|j||d�WS| |¡WSWn(tyPt dt¡| |¡YS0dS)Nr)rNz;Brotli >= 1.2.0 is required to prevent decompression bombs.)rLÚ TypeErrorÚwarningsÚwarnr )r!r1r-r"r"r#r/¹s þzBrotliDecoder.decompresscCs(z|j ¡ WSty"YdS0dS)NF)rZcan_accept_more_dataÚAttributeErrorr r"r"r#r3Ès z!BrotliDecoder.has_unconsumed_tailcCst|jdƒr|j ¡SdS)NÚflushr)rKrrSr r"r"r#rSÏs  zBrotliDecoder.flushN)r+)r+) r5r6r7r$rLr/r8r3rSr"r"r"r#rIªs    rIc@s:eZdZdZdZdd„Zdd„Zd dd „Zed d „ƒZ d S)Ú 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. écCsPdd„| d¡Dƒ}t|ƒ|jkrãrz)MultiDecoder.__init__..ú,z)Too many content encodings in the chain: z > cSsg|] }t|ƒ‘qSr")Ú _get_decoder©rXÚer"r"r#rZér)ÚsplitrFÚmax_decode_linksr Ú _decoders)r!ZmodesÚ encodingsr"r"r#r$âsÿÿÿzMultiDecoder.__init__cCs|jd ¡S©Nr)rarSr r"r"r#rSëszMultiDecoder.flushr+cCsˆ|dkr&t|jƒD]}| |¡}q|Stƒ}d}t|jƒD]"}|j||t|ƒd�}|r:d}q:||7}|rvt|ƒ|kr~t|ƒSd}q,dS)NrFr,Tr)Úreversedrar/rBrFrC)r!r1r-ÚdrHZany_datar"r"r#r/îs zMultiDecoder.decompresscCstdd„|jDƒƒS)Ncss|] }|jVqdSr%)r3)rXrer"r"r#Ú rz3MultiDecoder.has_unconsumed_tail..)Úanyrar r"r"r#r3sz MultiDecoder.has_unconsumed_tailN)r+) r5r6r7Ú__doc__r`r$rSr/r8r3r"r"r"r#rTÕs   rTcCs:d|vrt|ƒS|dkrtƒStdur4|dkr4tƒStƒS)Nr[ÚgzipÚbr)rTr>rJrIr)Úmoder"r"r#r\ sr\c@s0eZdZdZdd„Zdd„Zdd„Zdd „Zd S) ÚBytesQueueBuffera˜Memory-efficient bytes buffer To return decoded data in read() and still follow the BufferedIOBase API, we need a buffer to always return the correct amount of bytes. This buffer should be filled using calls to put() Our maximum memory usage is determined by the sum of the size of: * self.buffer, which contains the full data * the largest chunk that we will copy in get() cCst ¡|_d|_dSrc)Ú collectionsÚdequeÚbufferÚ_sizer r"r"r#r$(s zBytesQueueBuffer.__init__cCs|jSr%)rpr r"r"r#Ú__len__,szBytesQueueBuffer.__len__cCs"|j |¡|jt|ƒ7_dSr%)roÚappendrprF)r!r1r"r"r#Úput/s zBytesQueueBuffer.putc Cs|dkr dS|jstdƒ‚n|dkr,tdƒ‚t|jdƒ|krft|jdtƒrf|j|8_|j ¡Sd}t  ¡}||k�r||}|j ¡}t|ƒ}||krâ|d|…||d…}}|  |¡|j  |¡|j|8_�qn|  |¡|j|8_||7}|jsr�qqr|  ¡S)Nrrzbuffer is emptyzn should be > 0) roÚ RuntimeErrorÚ ValueErrorrFÚ isinstancerCrpÚpopleftÚioÚBytesIOÚwriteÚ appendleftÚgetvalue) r!ÚnZfetchedrHZ remainingÚchunkZ chunk_lengthZ left_chunkZ right_chunkr"r"r#Úget3s6 "      zBytesQueueBuffer.getN)r5r6r7rhr$rqrsrr"r"r"r#rls  rlc@sreZdZdZddgZedur&edg7Zgd¢ZdLd d „Zd d„Zdd„Z dd„Z e dd„ƒZ e dd„ƒZ dd„Zdd„Zdd„Zdd„ZeejfZedur¦eejf7ZdMdd „Zd!d"„Zed#d$„ƒZdNd%d&„ZdOd'd(„ZdPd*d+„Zed,d-„ƒZd.d/„ZdQd0d1„Z d2d3„Z!d4d5„Z"e d6d7„ƒZ#d8d9„Z$d:d;„Z%dd?„Z'd@dA„Z(dBdC„Z)dDdE„Z*dRdFdG„Z+dHdI„Z,dJdK„Z-dS)SÚ HTTPResponseaá 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. riZdeflateNrj)i-i.i/i3i4ÚrTFcCs&t|tƒr||_n t|ƒ|_||_||_||_||_||_d|_| |_ ||_ ||_ d|_ d|_ d|_| |_d|_| |_||_|r–t|tjtfƒr–||_ | |_| |_t|dƒr²||_d|_d|_|j dd¡ ¡}dd„| d¡Dƒ}d |vròd |_| |¡|_t ƒ|_!|�r"|j �s"|j"|d �|_ dS) NFrÚreadztransfer-encodingr�css|]}| ¡VqdSr%rV)rXÚencr"r"r#rfµrz(HTTPResponse.__init__..r[ÚchunkedT©Údecode_content)#rvrÚheadersÚstatusÚversionÚreasonÚstrictr†Ú_has_decoded_contentÚretriesÚenforce_content_lengthÚ auto_closeÚ_decoderÚ_bodyÚ_fpÚ_original_responseÚ_fp_bytes_readÚmsgÚ _request_urlrZ string_typesrCÚ_poolÚ _connectionrKr„Ú chunk_leftrÚlowerr_Ú _init_lengthÚlength_remainingrlÚ_decoded_bufferr‚)r!Úbodyr‡rˆr‰rŠr‹Zpreload_contentr†Úoriginal_responseZpoolÚ connectionr•r�rŽÚrequest_methodZ request_urlr�Ztr_encrbr"r"r#r$|sF    zHTTPResponse.__init__cCs|j|jvr|j d¡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. ÚlocationF)rˆÚREDIRECT_STATUSESr‡rr r"r"r#Úget_redirect_locationÃs  z"HTTPResponse.get_redirect_locationcCs(|jr |jsdS|j |j¡d|_dSr%)r—r˜Z _put_connr r"r"r#Ú release_connÐs zHTTPResponse.release_connc Cs@z | ¡Wnttttfy&Yn0|jr.r[rz8Content-Length contained multiple unmatching values (%s)r)éÌi0édéÈZHEAD) r‡rr„ÚlogZwarningÚsetr_rFrÚpoprur¬rˆ)r!r¡ÚlengthZlengthsrˆr"r"r#r›ÿs6 ÿ ÿÿ     &zHTTPResponse._init_lengthcshˆj dd¡ ¡}ˆjdurd|ˆjvr2t|ƒˆ_n2d|vrd‡fdd„| d¡Dƒ}t|ƒrdt|ƒˆ_dS)z= Set-up the _decoder attribute if necessary. úcontent-encodingr�Nr[cs"g|]}| ¡ˆjvr| ¡‘qSr")rWÚCONTENT_DECODERSr]r r"r#rZ>sþz.HTTPResponse._init_decoder..)r‡rršr�r¶r\r_rF)r!Úcontent_encodingrbr"r r#Ú _init_decoder3s    þzHTTPResponse._init_decoderc Cs¢|s|jrtdƒ‚|S|dus"|r&d}z |jrD|jj||d�}d|_WnF|jyŒ}z,|j dd¡ ¡}td||ƒ‚WYd}~n d}~00|rž||  ¡7}|S) zN Decode the data passed in and potentially flush the decoder. ú_Calling read(decode_content=False) is not supported after read(decode_content=True) was called.Nr+r,Trµr�zEReceived response with content-encoding: %s, but failed to decode it.) rŒrtr�r/ÚDECODER_ERROR_CLASSESr‡rršr Ú_flush_decoder)r!r1r†Ú flush_decoderr-r^r·r"r"r#Ú_decodeJs.ÿ  ÿý zHTTPResponse._decodecCs$|jr |j d¡}||j ¡SdS)zk Flushes the decoder. Should only be called if the decoder is actually being used. r)r�r/rS)r!Úbufr"r"r#r»is zHTTPResponse._flush_decoderc cs:d}zèz dVWn˜ty0t|jddƒ‚Ynztyt}z.dt|ƒvrRt|ƒ‚t|jddƒ‚WYd}~n>d}~0ttfy¨}ztd||ƒ‚WYd}~n d}~00d}W|sÔ|j rÄ|j   ¡|j rÔ|j   ¡|j rì|j   ¡rì|  ¡nH|�s|j �r|j   ¡|j �r|j   ¡|j �r4|j   ¡�r4|  ¡0dS)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)Ú SocketTimeoutrr—rÚstrrr r§rr“Úcloser˜rªr¥)r!Z clean_exitr^r"r"r#Ú_error_catcherts6    "$   ð  zHTTPResponse._error_catchercCsð|jdurdSt|jddƒ}| ¡�†|durB|s<|j ¡nd}n|sR|j |¡nd}|durœ|dkrœ|sœ|j ¡|jrœ|jdurœ|jdkrœt|j|jƒ‚Wdƒn1s°0Y|rì|jt |ƒ7_|jdurì|jt |ƒ8_|S)z7 Reads `amt` of bytes from the socket. NÚclosedFrr) r’r'rÂr‚rÁrŽrœrr”rF)r!ÚamtZ fp_closedr1r"r"r#r¦¬s*   ÿþý , zHTTPResponse._raw_readcCs�| ¡|dur|j}|dur€d}|jrf|jjrft|jƒ|krf|jd|d|t|jƒd�}|j |¡t|jƒ|kr€|j |¡S|  |¡}d}|durœd}n|dkr¬|s¬d}|sÐt|jƒdkrÐ|jrÌ|jjsÐ|S|durò| |||¡}|rð||_ nš|�s |j �rt dƒ‚|S|j||||t|jƒd�}|j |¡t|jƒ|k�r€|�r€|  |¡}|j||||t|jƒd�}|j |¡�q4|j |¡}|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.) NFr)r¼r-Trr¹r,) r¸r†r�r3rFr�r½rsrr¦r‘rŒrt)r!rÄr†r©Z decoded_datar1r¼r"r"r#r‚×s~ÿþ ý ü    ÿ þýýÿ ü   ü zHTTPResponse.readéccsn|jr*| ¡r*|j||d�D] }|Vqn@t|jƒrPt|jƒdksP|jrj|jjrj|j ||d�}|r*|Vq*dS)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. r…r)rÄr†N) r„Úsupports_chunked_readsÚ read_chunkedrr’rFr�r�r3r‚)r!rÄr†Úliner1r"r"r#Ústream7s ÿ þýýzHTTPResponse.streamc Ksb|j}t|tƒs.tjr"t |¡}n t| ¡ƒ}t|ddƒ}|f|||j|j |j ||dœ|¤Ž}|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``. r‹r)ržr‡rˆr‰rŠr‹rŸ) r•rvrrZPY2Ú from_httplibÚitemsr'rˆr‰rŠ)Z ResponseClsÚrZ response_kwr‡r‹Zrespr"r"r#rÊUs$     ùø zHTTPResponse.from_httplibcCs|jSr%©r‡r r"r"r#Ú getheadersvszHTTPResponse.getheaderscCs|j ||¡Sr%)r‡r)r!r)Údefaultr"r"r#Ú getheaderyszHTTPResponse.getheadercCs|jSr%rÍr r"r"r#Úinfo}szHTTPResponse.infocCs6|js|j ¡|jr |j ¡|js2tj |¡dSr%)rÃr’rÁr˜r�rxÚIOBaser r"r"r#rÁ�s   zHTTPResponse.closecCsT|jstjj |¡S|jdur"dSt|jdƒr8|j ¡St|jdƒrL|jjSdSdS)NTrªrÃ)r�rxrÒrÃÚ__get__r’rKrªr r"r"r#rËs    zHTTPResponse.closedcCs6|jdurtdƒ‚nt|jdƒr*|j ¡Stdƒ‚dS)Nz-HTTPResponse has no file to get a fileno fromÚfilenozOThe file-like object this HTTPResponse is wrapped around has no file descriptor)r’ÚIOErrorrKrÔr r"r"r#rÔ˜s    ÿzHTTPResponse.filenocCs2|jdur.t|jdƒr.t|jddƒs.|j ¡SdS)NrSrÃF)r’rKr'rSr r"r"r#rS£sÿ þ ýzHTTPResponse.flushcCsdS)NTr"r r"r"r#Úreadable«szHTTPResponse.readablecCs:| t|ƒ¡}t|ƒdkrdS||dt|ƒ…<t|ƒSdSrc)r‚rF)r!ÚbZtempr"r"r#Úreadinto¯s  zHTTPResponse.readintocCs t|jdƒ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(). Úfp)rKr’r r"r"r#rƸsz#HTTPResponse.supports_chunked_readscCsd|jdurdS|jj ¡}| dd¡d}zt|dƒ|_Wn$ty^| ¡t||ƒ‚Yn0dS)Nó;rrr?) r™r’rÙÚreadliner_r¬rurÁr)r!rÈr"r"r#Ú_update_chunk_lengthÁs   z!HTTPResponse._update_chunk_lengthcCs¬d}|dur2|j |j¡}|}|j d¡d|_nv||jkrZ|j |¡}|j||_|}nN||jkrˆ|j |¡}|j d¡d|_|}n |j |j¡}|j d¡d|_|S)Nr:)r’Z _safe_readr™)r!rÄZreturned_chunkr~Úvaluer"r"r#Ú _handle_chunkÏs&        zHTTPResponse._handle_chunkccs| ¡|jstdƒ‚| ¡s&tdƒ‚| ¡�Ö|jrZt|jƒrZ|j ¡WdƒdS|j j durvWdƒdS|  ¡|j dkrŠq²|  |¡}|j||d|d�}|rv|Vqv|rÈ| ¡}|rÈ|V|j j  ¡}|sÚqæ|dkrÈqæqÈ|jrö|j ¡Wdƒn1�s 0YdS)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.NrF)r†r¼r-s )r¸r„rrÆr rÂr“rrÁr’rÙrÜr™rÞr½r»rÛ)r!rÄr†r~ZdecodedrÈr"r"r#rÇåsLÿÿ     ü zHTTPResponse.read_chunkedcCs.|jdur$t|jjƒr$|jjdjS|jSdS)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. Nr+)r�rFÚhistoryZredirect_locationr–r r"r"r#Úgeturl.szHTTPResponse.geturlccs”g}|jdd�D]n}d|vrt| d¡}d |¡|ddV|dd…D]}|dVqJ|drn|dg}q~g}q| |¡q|r�d |¡VdS)NTr…ó rrrr+)rÉr_Újoinrr)r!ror~Úxr"r"r#Ú__iter__9s    zHTTPResponse.__iter__)r�NrrNrTTNNNNNFNNT)N)N)NNF)rÅN)N)NN).r5r6r7rhr¶rJr£r$r¤r¥r¨r8r1r rªr«r›r¸rÕrrrºr½r»rrÂr¦r‚rÉÚ classmethodrÊrÎrÐrÑrÁrÃrÔrSrÖrØrÆrÜrÞrÇràrär"r"r"r#r€Vs|  î G   4     7 + `         I r€)3Z __future__rrmrxZloggingrrPÚ contextlibrZsocketrr§rr¿rJÚ ImportErrorÚ _collectionsrr rr Ú exceptionsr r r r rrrrrrrZpackagesrZ util.responserrZ getLoggerr5r±Úobjectrr9r>rIrTr\rlrÒr€r"r"r"r#Ús6        4  ;@ +8 <