Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.15.20.178
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : response.cpython-312.pyc
�

=fb��	�t�ddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZddlmZddlmZe	j,rddlmZ		ddlZ	ddlZeee ejBd	ejD�jG���xZ$Z$e$d
krdZddl'm(Z(ddlm)Z)dd
l*m+Z+ddl,m-Z-m.Z.m/Z/ddl0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:ddl;m<Z<m=Z=ddl>m?Z?e	j,rddl	m@Z@ddlAmBZBej�eD�ZEGd�d�ZFGd�deF�ZGGd�d�ZHGd�deF�ZIe�Gd�deF�ZJe�Gd�deF�ZKGd �d!eF�ZLd)d"�ZMGd#�d$�ZNGd%�d&ej��ZPGd'�d(eP�Zy#e$rddlZY��<wxYw#e$rdZY��JwxYw#e%ee&f$rdZY��wxYw)*�)�annotationsN)�contextmanager)�HTTPMessage)�HTTPResponse)�timeout�)�BaseHTTPConnectionz^([0-9]+)\.([0-9]+))r�)�util)�
_TYPE_BODY)�HTTPHeaderDict)�BaseSSLError�HTTPConnection�
HTTPException)
�BodyNotHttplibCompatible�DecodeError�	HTTPError�IncompleteRead�InvalidChunkLength�
InvalidHeader�
ProtocolError�ReadTimeoutError�ResponseNotChunked�SSLError)�is_fp_closed�is_response_to_head)�Retry)�Literal)�HTTPConnectionPoolc��eZdZdd�Zdd�Zy)�ContentDecoderc��t���N��NotImplementedError��self�datas  �G/usr/local/python-3.12/lib/python3.12/site-packages/urllib3/response.py�
decompresszContentDecoder.decompressH���!�#�#�c��t��r#r$�r's r)�flushzContentDecoder.flushKr+r,N�r(�bytes�returnr1�r2r1)�__name__�
__module__�__qualname__r*r/�r,r)r!r!Gs��$�$r,r!c�$�eZdZdd�Zdd�Zdd�Zy)�DeflateDecoderc�R�d|_d|_tj�|_y)NTr,)�
_first_try�_data�zlib�
decompressobj�_objr.s r)�__init__zDeflateDecoder.__init__Ps �������
��&�&�(��	r,c���|s|S|js|jj|�S|xj|z
c_	|jj|�}|rd|_d|_|S#tj
$rbd|_t	jtj�|_	|j|j�d|_cYS#d|_wxYwwxYw)NF)r;r?r*r<r=�errorr>�	MAX_WBITS)r'r(�decompresseds   r)r*zDeflateDecoder.decompressUs�����K�����9�9�'�'��-�-��
�
�d��
�	"��9�9�/�/��5�L��"'���!��
�����z�z�	"�#�D�O��*�*�D�N�N�?�;�D�I�
"����t�z�z�2�!��
��T��
��
	"�s%�,A/�/AC$�3C�
C$�	C � C$c�6�|jj�Sr#�r?r/r.s r)r/zDeflateDecoder.flushk����y�y��� � r,N�r2�Noner0r3�r4r5r6r@r*r/r7r,r)r9r9Os��)�
"�,!r,r9c��eZdZdZdZdZy)�GzipDecoderStaterr�N)r4r5r6�FIRST_MEMBER�
OTHER_MEMBERS�SWALLOW_DATAr7r,r)rLrLos���L��M��Lr,rLc�$�eZdZdd�Zdd�Zdd�Zy)�GzipDecoderc��tjdtjz�|_tj
|_y�N�)r=r>rCr?rLrN�_stater.s r)r@zGzipDecoder.__init__vs*���&�&�r�D�N�N�':�;��	�&�3�3��r,c�$�t�}|jtjk(s|st	|�S		||j
j
|�z
}|j
j}|st	|�Stj|_tjdtjz�|_��#tj$rC|j}tj|_|tjk(r
t	|�cYS�wxYwrT)
�	bytearrayrVrLrPr1r?r*r=rBrO�unused_datar>rC)r'r(�ret�previous_states    r)r*zGzipDecoder.decompresszs����k���;�;�*�7�7�7�t���:���	
��t�y�y�+�+�D�1�1���9�9�(�(�D���S�z�!�*�8�8�D�K��*�*�2����+>�?�D�I����:�:�
�!%����.�;�;���!�%5�%C�%C�C� ��:�%��
�s�B9�9AD�
Dc�6�|jj�Sr#rFr.s r)r/zGzipDecoder.flush�rGr,NrHr0r3rJr7r,r)rRrRus��4�@�*!r,rRc��eZdZdd�Zdd�Zy)�
BrotliDecoderc���tj�|_t|jd�r"t	|d|jj
�yt	|d|jj�y)Nr*)�brotli�Decompressorr?�hasattr�setattrr*�processr.s r)r@zBrotliDecoder.__init__�sL���+�+�-�D�I��t�y�y�,�/���l�D�I�I�,@�,@�A���l�D�I�I�,=�,=�>r,c�d�t|jd�r|jj�Sy)Nr/r,)rbr?r/r.s r)r/zBrotliDecoder.flush�s$���t�y�y�'�*��y�y���(�(�r,NrHr3)r4r5r6r@r/r7r,r)r^r^�s��	?�	r,r^c�$�eZdZdd�Zdd�Zdd�Zy)�ZstdDecoderc�R�tj�j�|_yr#)�zstd�ZstdDecompressorr>r?r.s r)r@zZstdDecoder.__init__�s���-�-�/�=�=�?�D�Ir,c���|sy|jj|�g}|jjr�|jjr�|jj}t	j
�j
�|_|j|jj|��|jjr|jjr��dj|�S)Nr,)	r?r*�eofrYrirjr>�append�join)r'r(�
data_partsrYs    r)r*zZstdDecoder.decompress�s������)�)�.�.�t�4�5�J��)�)�-�-�D�I�I�$9�$9�"�i�i�3�3�� �1�1�3�A�A�C��	��!�!�$�)�)�"6�"6�{�"C�D��)�)�-�-�D�I�I�$9�$9��8�8�J�'�'r,c�|�|jj�}|jjstd��|S)NzZstandard data is incomplete)r?r/rlr)r'rZs  r)r/zZstdDecoder.flush�s.���)�)�/�/�#�C��9�9�=�=�!�"@�A�A��Jr,NrHr0r3rJr7r,r)rgrg�s��	@�	(�	r,rgc�(�eZdZdZdd�Zdd�Zdd�Zy)	�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.
    c��|jd�D�cgc]}t|j����c}|_ycc}w)N�,)�split�_get_decoder�strip�	_decoders)r'�modes�ms   r)r@zMultiDecoder.__init__�s+��;@�;�;�s�;K�L�a�,�q�w�w�y�1�L����Ls� =c�<�|jdj�S�Nr)rxr/r.s r)r/zMultiDecoder.flush�s���~�~�a� �&�&�(�(r,c�\�t|j�D]}|j|�}�|Sr#)�reversedrxr*)r'r(�ds   r)r*zMultiDecoder.decompress�s-���$�.�.�)�	&�A��<�<��%�D�	&��r,N)ry�strr2rIr3r0)r4r5r6�__doc__r@r/r*r7r,r)rrrr�s���M�)�r,rrc��d|vrt|�S|dvr
t�St�|dk(r
t�St�|dk(r
t�St
�S)Nrt)�gzip�x-gzip�brri)rrrRr`r^rirgr9)�modes r)rvrv�sX��
�d�{��D�!�!��!�!��}��
��d�d�l������D�F�N��}����r,c�8�eZdZdZdd�Zd	d�Zd
d�Zdd�Zdd�Zy)
�BytesQueueBufferaMemory-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()

    The worst case scenario is a single chunk, in which case we'll make a full copy of
    the data inside get().
    c�D�tj�|_d|_yr|)�collections�deque�buffer�_sizer.s r)r@zBytesQueueBuffer.__init__�s��+6�+<�+<�+>�����
r,c��|jSr#)r�r.s r)�__len__zBytesQueueBuffer.__len__�s���z�z�r,c�v�|jj|�|xjt|�z
c_yr#)r�rmr��lenr&s  r)�putzBytesQueueBuffer.put�s&�������4� ��
�
�c�$�i��
r,c�d�|dk(ry|jstd��|dkrtd��d}tj�}||kr�||z
}|jj�}t
|�}||kr\|d|||d}}|j|�|jj|�|xj|zc_		|j�S|j|�|xj|zc_	||z
}|js	|j�S||kr��|j�S)Nrr,zbuffer is emptyzn should be > 0)r��RuntimeError�
ValueError�io�BytesIO�popleftr��write�
appendleftr��getvalue)	r'�n�fetchedrZ�	remaining�chunk�chunk_length�
left_chunk�right_chunks	         r)�getzBytesQueueBuffer.gets����6������0�1�1�
��U��.�/�/����j�j�l����k��G��I��K�K�'�'�)�E��u�:�L��<�'�*/�
��*;�U�9�:�=N�K�
��	�	�*�%����&�&�{�3��
�
�i�'�
���|�|�~���	�	�%� ��
�
�l�*�
��|�#�G��;�;���|�|�~��%��k�$�|�|�~�r,c�4��|j��s|jdk(sJ�yt��dk(r�j�}nPt	j
�}|j
�fd�tt���D��|j�}d|_|S)Nrr,rc3�>�K�|]}�j����y�wr#)r�)�.0�_r�s  �r)�	<genexpr>z+BytesQueueBuffer.get_all.<locals>.<genexpr>'s�����H��6�>�>�+�H�s�)	r�r�r��popr�r��
writelines�ranger�)r'�resultrZr�s   @r)�get_allzBytesQueueBuffer.get_allsv���������:�:��?�"�?���v�;�!���Z�Z�\�F��*�*�,�C��N�N�H�U�3�v�;�5G�H�H��\�\�^�F���
��
r,NrH�r2�int)r(r1r2rI)r�r�r2r1r3)	r4r5r6r�r@r�r�r�r�r7r,r)r�r��s ��� �� ��<r,r�c�L�eZdZUgd�Ze�edgz
Ze�edgz
Zgd�ZeejfZ
ded<e�e
ejfz
Z
e�e
ejfz
Z
ddd�															d!d	�Z
d"d
�Zed#d��Zd$d�Zed%d
��Zej&d&d��Zed'd��Zed(d��Zej&d)d��Z	d*					d+d�Z			d,							d-d�Z		d.					d/d�Z		d.					d+d�Zd0d�Zd0d�Zd0d�Zd0d�Z								d1d�Zd#d�Zd2d�Z d3d�Z!d4d5d�Z"d3d�Z#d%d �Z$y)6�BaseHTTPResponse)r�r��deflateNr�ri)i-i.i/i3i4ztuple[type[Exception], ...]�DECODER_ERROR_CLASSES)�headers�retriesc�p�t|t�r||_nt|�|_||_||_||_||_d|_||_||_	d|_
|jjdd�j�}d�|jd�D�}	d|	vrd|_
d|_|y)NFztransfer-encoding�c3�<K�|]}|j����y�wr#)rw)r��encs  r)r�z,BaseHTTPResponse.__init__.<locals>.<genexpr>Vs����>�S�S�Y�Y�[�>�s�rt�chunkedT)�
isinstancer
r��status�version�reason�decode_content�_has_decoded_content�_request_urlr�r�r��lowerru�_decoder)
r'r�r�r�r�r��request_urlr��tr_enc�	encodingss
          r)r@zBaseHTTPResponse.__init__<s����g�~�.�"�D�L�)�'�2�D�L����������,���$)��!�(3������������!�!�"5�r�:�@�@�B��>�F�L�L��,=�>�	��	�!��D�L�/3��
�r,c�j�|j|jvr|jjd�Sy)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�r�r.s r)�get_redirect_locationz&BaseHTTPResponse.get_redirect_location]s.���;�;�$�0�0�0��<�<�#�#�J�/�/�r,c��t��r#r$r.s r)r(zBaseHTTPResponse.datai���!�#�#r,c�b�|jjd�}tj|�S)a
        Parses the body of the HTTP response as JSON.

        To use a custom JSON decoder pass the result of :attr:`HTTPResponse.data` to the decoder.

        This method can raise either `UnicodeDecodeError` or `json.JSONDecodeError`.

        Read more :ref:`here <json>`.
        zutf-8)r(�decode�_json�loadsr&s  r)�jsonzBaseHTTPResponse.jsonms'���y�y����(���{�{�4� � r,c��t��r#r$r.s r)�urlzBaseHTTPResponse.urlzr�r,c��t��r#r$�r'r�s  r)r�zBaseHTTPResponse.url~r�r,c��t��r#r$r.s r)�
connectionzBaseHTTPResponse.connection�r�r,c��|jSr#)�_retriesr.s r)r�zBaseHTTPResponse.retries�s���}�}�r,c�j�|�*|jr|jdj|_||_y)N���)�history�redirect_locationr�r�)r'r�s  r)r�zBaseHTTPResponse.retries�s-����7�?�?����r�*�<�<�D�H���
r,c��t��r#r$�r'�amtr�s   r)�streamzBaseHTTPResponse.stream�s
��"�#�#r,c��t��r#r$)r'r�r��
cache_contents    r)�readzBaseHTTPResponse.read�s
��"�#�#r,c��t��r#r$r�s   r)�read1zBaseHTTPResponse.read1��
��
"�#�#r,c��t��r#r$r�s   r)�read_chunkedzBaseHTTPResponse.read_chunked�r�r,c��t��r#r$r.s r)�release_connzBaseHTTPResponse.release_conn�r+r,c��t��r#r$r.s r)�
drain_connzBaseHTTPResponse.drain_conn�r+r,c��t��r#r$r.s r)�closezBaseHTTPResponse.close�r+r,c�z�|jjdd�j�}|j��||jvrt|�|_yd|vr\|j
d�D�cgc].}|j�|jvr|j���0}}|rt|�|_yyyycc}w)z=
        Set-up the _decoder attribute if necessary.
        �content-encodingr�Nrt)r�r�r�r��CONTENT_DECODERSrvrurw)r'�content_encoding�er�s    r)�
_init_decoderzBaseHTTPResponse._init_decoder�s��� �<�<�+�+�,>��C�I�I�K���=�=� ��4�#8�#8�8� ,�-=� >��
��(�(�.�3�3�C�8����w�w�y�D�$9�$9�9��G�G�I��	��
�$0�1A�$B�D�M��
)�!��s�-3B8c�f�|s|jrtd��|S	|jr"|jj|�}d|_|r||j�z
}|S#|j$r?}|j
j
dd�j�}td|z|�|�d}~wwxYw)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.Tr�r�zEReceived response with content-encoding: %s, but failed to decode it.N)
r�r�r�r*r�r�r�r�r�_flush_decoder)r'r(r��
flush_decoderr�r�s      r)�_decodezBaseHTTPResponse._decode�s�����(�(�"�<����K�
	��}�}��}�}�/�/��5��,0��)���D�'�'�)�)�D�����)�)�	�#�|�|�/�/�0B�B�G�M�M�O���'�)9�:����	
��	�s�.A"�"B0�1:B+�+B0c��|jr6|jjd�|jj�zSy)zk
        Flushes the decoder. Should only be called if the decoder is actually
        being used.
        r,)r�r*r/r.s r)r�zBaseHTTPResponse._flush_decoder�s5��
�=�=��=�=�+�+�C�0�4�=�=�3F�3F�3H�H�H�r,c��|jt|��}t|�dk(ry||dt|�t|�Sr|)r�r�)r'�b�temps   r)�readintozBaseHTTPResponse.readinto�s;���y�y��Q�� ���t�9��>��!�A�k��D�	�N��t�9�r,c�R�tjdtd��|jS)Nz|HTTPResponse.getheaders() is deprecated and will be removed in urllib3 v2.1.0. Instead access HTTPResponse.headers directly.rM��category�
stacklevel)�warnings�warn�DeprecationWarningr�r.s r)�
getheaderszBaseHTTPResponse.getheaders�s&���
�
�
O�'��		
��|�|�r,c�r�tjdtd��|jj	||�S)Nz�HTTPResponse.getheader() is deprecated and will be removed in urllib3 v2.1.0. Instead use HTTPResponse.headers.get(name, default).rMr)rrrr�r�)r'�name�defaults   r)�	getheaderzBaseHTTPResponse.getheaders3���
�
�
V�'��		
��|�|����g�.�.r,c��|jSr#)r�r.s r)�infozBaseHTTPResponse.infos���|�|�r,c��|jSr#)r�r.s r)�geturlzBaseHTTPResponse.geturls���x�x�r,)r��>typing.Mapping[str, str] | typing.Mapping[bytes, bytes] | Noner�r�r�r�r��
str | Noner��boolr�rr��Retry | Noner2rI)r2zstr | None | Literal[False]r3)r2z
typing.Any�r2r)r�rr2rI)r2zBaseHTTPConnection | None)r2r)r�rr2rI�iN)r��
int | Noner��bool | Noner2�typing.Iterator[bytes]�NNF�r�rr�rr�rr2r1�NN�r�rr�rr2r1rH)r(r1r�rr�rr2r1)r�rXr2r�)r2r
r#)r	r�r
rr2r)%r4r5r6r�r`rir��IOErrorr=rBr��__annotations__�	ZstdErrorr@r��propertyr(r�r��setterr�r�r�r�r�r�r�r�r�r�r�r�r�rrr
rr7r,r)r�r�-si��4��
���T�F�"�����V�H�$��1��:A�4�:�:�9N��6�N�
���&�,�,��0�����$�.�.�!2�2��
SW�!%�*�P�*��	*�
�*��
*��*� �*��*�
�*�B
��$��$�!��$��$�	�Z�Z�$��$��$��$�����
�^�^� �� �FJ�$��$�7B�$�	�$��&*�#�	$�
�$�$�$��	$�

�$��&*�$�
�$�$�$�
�	$��&*�$�
�$�$�$�
 �	$�$�$�$�C�&���+6��GK��	��<���/��r,r�c�
��eZdZdZ																d																																	d�fd�
Zd d�Zd d�Zed!d��Zed"d��Z	d#d�Z
d$d�Zd%d	�Ze
d&d
��Z	d'dd�					d(d
�Z	d'dd�					d(d�Z			d)							d*d�Z		d+					d,d�Z	d-					d.d�Zd#d�Zd d�Zed#d��Zd$d�Zd d�Zd#d�Zd d�Zd/d�Z	d+					d.d�Zed0d��Zej<d1d��Zd2d�Z�xZ S)3ra�
    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.
    c	���t�|�|||||||��|
|_||_d|_d|_||_d|_||_|rt|ttf�r||_|	|_|
|_
t|d�r||_d|_|j!|�|_t%�|_|r%|js|j)|��|_yyy)N)r�r�r�r�r�r�r�rr��r�)�superr@�enforce_content_length�
auto_close�_body�_fp�_original_response�_fp_bytes_read�msgr�r�r1�_pool�_connectionrb�
chunk_left�_init_length�length_remainingr��_decoded_bufferr�)r'�bodyr�r�r�r��preload_contentr��original_response�poolr�r,r�r&�request_methodr�r'�	__class__s                 �r)r@zHTTPResponse.__init__4s����&	�������)�#��	�	
�'=��#�$�����
�04���"3����������J�t�c�5�\�2��D�J���
�%����4�� ��D�H�'+���!%� 1� 1�.� A��� 0�1����4�:�:����.��A�D�J�$.�?r,c��|jr|jsy|jj|j�d|_yr#)r-r.�	_put_connr.s r)r�zHTTPResponse.release_connps4���z�z��!1�!1���
�
���T�-�-�.���r,c�d�	|j�y#ttttf$rYywxYw)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�OSErrorrrr.s r)r�zHTTPResponse.drain_connws+��	��I�I�K���7�L�-�@�	��	�s��/�/c�p�|jr|jS|jr|jd��Sy)NT)r�)r(r)r�r.s r)r(zHTTPResponse.data�s0���:�:��:�:���8�8��9�9�4�9�0�0�r,c��|jSr#)r.r.s r)r�zHTTPResponse.connection�s�����r,c�,�t|j�Sr#)rr)r.s r)�isclosedzHTTPResponse.isclosed�s���D�H�H�%�%r,c��|jS)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).
        )r+r.s r)�tellzHTTPResponse.tell�s���"�"�"r,c���|jjd�}|�~|jrtj	d�y	|jd�D�chc]
}t
|���}}t|�dkDrtd|z��|j�}|dkrd}nd}	t
|j�}|dvsd	|cxkrd
ksn|dk(rd}|Scc}w#t$rd}Y�BwxYw#t$rd}Y�=wxYw)zM
        Set initial length value for Response content if available.
        zcontent-lengthNz�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.rtrz8Content-Length contained multiple unmatching values (%s)r)��i0�d���HEAD)r�r�r��log�warningrur�r�rr�r�r�)r'r7�content_length�val�lengths�lengthr�s       r)r0zHTTPResponse._init_length�s��
&*�\�\�%5�%5�6F�%G���%��|�|�������
"�0>�/C�/C�C�/H�I��3�s�8�I��I��w�<�!�#�'�1�3A�B���!������A�:�!�F��F�	�����%�F�
�Z��3�&�#6�3�#6�.�F�:R��F��
��7J���
���
���	��F�	�s6�C�C�&.C�C$�C�C!� C!�$C2�1C2c#�K�d}		d��d}|sL|jr|jj�|jr|jj�|jr,|jj�r|j!�yyy#t$r}t|jdd�|�d}~wt$r6}dt	|�vrt|�|�t|jdd�|�d}~wt$rL}|j�)|j�|j|jk(rd}nd|��}t||�|�d}~wttf$r}td|��|�|�d}~wwxYw#|sL|jr|jj�|jr|jj�|jr,|jj�r|j!�wwwxYw�w)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 outz!Response may not contain content.zConnection broken: T)�
SocketTimeoutrr-rr�rr�expected�partialrrr<r*r�r.r@r�)r'�
clean_exitr��args    r)�_error_catcherzHTTPResponse._error_catcher�s������
�5	$�
K��>�J���*�*��+�+�1�1�3�
�#�#��$�$�*�*�,��&�&�4�+B�+B�+K�+K�+M��!�!�#�,N�&��a!�
S�'�t�z�z�4�9J�K�QR�R���
S�-�S��V�;�"�1�+�1�,�&�t�z�z�4�9J�K�QR�R��!�	
3��J�J�*��	�	�-��
�
�q�y�y�j�0�=�C�/��u�5�C�#�C��+��2��!�7�+�
K�#�&9�!��$?��C��J��
K����*�*��+�+�1�1�3�
�#�#��$�$�*�*�,��&�&�4�+B�+B�+K�+K�+M��!�!�#�,N�&�s_�G:�B�E/�BG:�	E,�B5�5E,�1C2�2E,�>AE�E,�E'�'E,�,E/�/BG7�7G:F�r�c���|jsJ�d}|r||kDs|��|jr�|j|kDr�tjstj
dkr�|r|jj
|�Stj�}d}|�|dk7r_|�t||�}||z}n|}|jj|�}|s	|j�S|j|�~|��Y|dk7r�_|j�S|r7|�|jj
|�S|jj
�S|�|jj|�S|jj�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���)��
ir)
r)r1r�IS_PYOPENSSL�sys�version_infor�r�r��minr�r�r�)r'r�r��	c_int_maxr��
max_chunk_amt�	chunk_amtr(s        r)�_fp_readzHTTPResponse._fp_readsH��&�x�x��x��	�
�S�9�_����)�)��)�)�I�5�� � �C�$4�$4�w�$>���x�x�~�~�i�0�0��Z�Z�\�F�"�M��+�����?� #�C�� 7�I��9�$�C� -�I��x�x�}�}�Y�/�����?�?�$�$����T�"���+�����?�?�$�$�
�*-�/�4�8�8�>�>�#�&�O�t�x�x�~�~�?O�O�*-��4�8�8�=�=��%�M�d�h�h�m�m�o�Mr,c��|j�yt|jdd�}|j�5|s|j||��nd}|�h|dk7rc|sa|jj	�|j
rv|j�j|jdk7r[t|j|j��|r9|dk7r|r|jt|�k(r|jj	�ddd�rH|xjt|�z
c_|j�|xjt|�zc_|S#1swY�UxYw)z7
        Reads `amt` of bytes from the socket.
        N�closedFrUr,r)
r)�getattrrTr`r�r&r1rr+r�)r'r�r��	fp_closedr(s     r)�	_raw_readzHTTPResponse._raw_readOs$���8�8����D�H�H�h��6�	�
�
 �
 �
"�	!�:C�4�=�=��E�=�2��D���3�!�8�D������ ��/�/��-�-�9��-�-��2�)��)<�)<�d�>S�>S�T�T�����$�4�+@�+@�C��I�+M������ �=	!�@����3�t�9�,���$�$�0��%�%��T��2�%���I	!�	!�s�B=E�Ec��|j�|�|j}|�5d}t|j�|k\r|jj	|�S|j|�}|duxs
|dk7xr|}|st|j�dk(r|S|�|j
|||�}|r||_|S|s|jrtd��|S|j
|||�}|jj|�t|j�|kr\|rZ|j|�}|j
|||�}|jj|�t|j�|kr|r�Z|jj	|�}|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.)
        NFrr�)r�r�r�r2r�rer�r(r�r�r�)r'r�r�r�r(r��decoded_datas       r)r�zHTTPResponse.read�s���4	
�����!�!�0�0�N��?�!�M��4�'�'�(�C�/��+�+�/�/��4�4��~�~�c�"���t��>��q��(=��X�
���D�0�0�1�Q�6��K��;��<�<��n�m�D�D��!��
�.��)"��,�,�&�@������<�<��n�m�L�L�� � �$�$�\�2��d�*�*�+�c�1�d��~�~�c�*��#�|�|�D�.�-�P���$�$�(�(��6�
�d�*�*�+�c�1�d��'�'�+�+�C�0�D��r,c�P�|�|j}|jr\|std��t|j�dkDr7|�|jj�S|jj
|�S|dk(ry|j|d��}|r|�|S|j�	|}|j|||�}|jj|�|s|rn|jdd��}�J|�|jj�S|jj
|�S)a�
        Similar to ``http.client.HTTPResponse.read1`` and documented
        in :meth:`io.BufferedReader.read1`, but with an additional parameter:
        ``decode_content``.

        :param amt:
            How much of the content to read.

        :param decode_content:
            If True, will attempt to decode the body based on the
            'content-encoding' header.
        zaCalling read1(decode_content=False) is not supported after read1(decode_content=True) was called.rr,TrUi )r�r�r�r�r2r�r�rer�r�r�)r'r�r�r(r�rgs      r)r�zHTTPResponse.read1�s1��"�!�!�0�0�N��$�$�!�"�=����4�'�'�(�1�,��;��/�/�7�7�9�9��+�+�/�/��4�4��!�8���~�~�c��~�.������K������ $�H�M��<�<��n�m�L�L�� � �$�$�\�2��}���>�>�$�d�>�3�D�
��;��'�'�/�/�1�1��#�#�'�'��,�,r,c#�lK�|jr,|j�r|j||��Ed{���yt|j�rt|j�dkDrI|j||��}|r|��t|j�s�/t|j�dkDr�Hyy7�|�w)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$Nr)r�r�)r��supports_chunked_readsr�rr)r�r2r�)r'r�r�r(s    r)r�zHTTPResponse.stream�s�����$�<�<�D�7�7�9��(�(��^�(�L�L�L�"�4�8�8�,��D�4H�4H�0I�A�0M��y�y�S��y�H����J�	#�4�8�8�,��D�4H�4H�0I�A�0M�
M�s�3B4�B2�A B4�B4�0B4c��y)NTr7r.s r)�readablezHTTPResponse.readables��r,c��|js&|jr|jj�|jr|jj�|js t
jj|�yyr#)rbr)r�r.r'r��IOBaser.s r)r�zHTTPResponse.closesT���{�{�t�x�x��H�H�N�N��������"�"�$�����I�I�O�O�D�!�r,c�@�|js)tjjj	|�S|j
�yt
|j
d�r|j
j�St
|j
d�r|j
jSy)NTr@rb)r'r�rnrb�__get__r)rbr@r.s r)rbzHTTPResponse.closed&sq������9�9�#�#�+�+�D�1�1�
�X�X�
��
�T�X�X�z�
*��8�8�$�$�&�&�
�T�X�X�x�
(��8�8�?�?�"�r,c��|j�td��t|jd�r|jj�Std��)Nz-HTTPResponse has no file to get a fileno from�filenozOThe file-like object this HTTPResponse is wrapped around has no file descriptor)r)r<rbrrr.s r)rrzHTTPResponse.fileno3sI���8�8���I�J�J�
�T�X�X�x�
(��8�8�?�?�$�$��0��
r,c��|j�It|jd�r2t|jdd�s|jj�Syyy)Nr/rbF)r)rbrcr/r.s r)r/zHTTPResponse.flush>sJ���H�H� �����'�*��D�H�H�h��6��8�8�>�>�#�#�7�+�
!r,c�.�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)rbr)r.s r)rjz#HTTPResponse.supports_chunked_readsFs���t�x�x��&�&r,c�$�|j�y|jjj�}|j	dd�d}	t|d�|_y#t$r,|j�|r
t||�d�td�d�wxYw)N�;rrrUzResponse ended prematurely)
r/r)ru�readlinerur�r�r�rr)r'�lines  r)�_update_chunk_lengthz!HTTPResponse._update_chunk_lengthOs����?�?�&���x�x�{�{�#�#�%���z�z�$��"�1�%��		L�!�$��m�D�O���	L��J�J�L��(��t�4�$�>�$�$@�A�t�K�	L�s�A�5Bc�n�d}|�K|jj|j�}|}|jjd�d|_|S|j�B||jkr3|jj|�}|j|z
|_|}|S||jk(rA|jj|�}|jjd�d|_|}|S|jj|j�}|jjd�d|_|S)NrM)r)�
_safe_readr/)r'r��returned_chunkr��values     r)�
_handle_chunkzHTTPResponse._handle_chunkas�����;��H�H�'�'����8�E�"�N��H�H����"�"�D�O����_�_�
(�S�4�?�?�-B��H�H�'�'��,�E�"�o�o��3�D�O�"�N����D�O�O�
#��H�H�'�'��,�E��H�H����"�"�D�O�"�N�
��"�X�X�0�0����A�N��H�H����"�"�D�O��r,c#�FK�|j�|jstd��|j�st	d��|j�5|jr9t|j�r$|jj�	ddd�y|jj�
	ddd�y	|j�|jdk(rn,|j|�}|j||d��}|r|���L|r|j�}|r|��|j�:|jjj!�}|sn|dk(rn
|j��:|jr|jj�ddd�y#1swYyxYw�w)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�s
)r�r�rrjrrTr*rr�r)rurzr/rr�r�rx)r'r�r�r��decodedrys      r)r�zHTTPResponse.read_chunkedws����� 	
�����|�|�$�B��
��*�*�,�*�P��
�
�
 �
 �
"�)	0��&�&�+>�t�?V�?V�+W��'�'�-�-�/��	)	0�)	0��x�x�{�{�"��)	0�)	0���)�)�+��?�?�a�'���*�*�3�/���,�,��.��'����!�M����-�-�/���!�M��(�(�&��x�x�{�{�+�+�-�����7�?��
�(�(�&��&�&��'�'�-�-�/�S)	0�)	0�)	0�s=�AF!�=F�	F!�F�2	F!�;B*F�&&F�	F!�F�F!c��|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.
        �r�r.s r)r�zHTTPResponse.url�s��� � � r,c��||_yr#r�r�s  r)r�zHTTPResponse.url�s
����r,c#�.K�g}|jd��D]d}d|vrM|jd�}dj|�|dzdz��|ddD]	}|dz���|dr|dg}�Qg}�T|j|��f|rdj|���yy�w)NTr$�
r,rrr�)r�rurnrm)r'r�r��chunks�xs     r)�__iter__zHTTPResponse.__iter__�s����� ���[�[��[�5�	%�E���~����U�+���h�h�v�&����2�U�:�:���"��$�A��e�)�O�$��"�:�$�R�j�\�F��F��
�
�e�$�	%���(�(�6�"�"��s�BB)r�NrrNTTNNNNNTNNT)"r3rr�rr�r�r�r�r�rr4rr�rr5z_HttplibHTTPResponse | Noner6zHTTPConnectionPool | Noner��HTTPConnection | Noner,z_HttplibHTTPMessage | Noner�rr&rr7rr�rr'rr2rIrHr3)r2r�)r2rr�)r7rr2r)r2z"typing.Generator[None, None, None]r#)r�rr�rr2r1rrrrr)r�rr�rr2z#typing.Generator[bytes, None, None])r�rr2r1r)r�r�r2rI)r2r)!r4r5r6r�r@r�r�r r(r�r@rBr0rrTr`rer�r�r�rlr�rbrrr/rjrzrr�r�r!r��
__classcell__)r8s@r)rrs�����D�RV���!� $�#�9=�*.�,0�*.� $�'+�%)�"&��#:B��:B�P�:B��	:B�
�:B��
:B��:B��:B�7�:B�(�:B�*�:B�(�:B��:B�!%�:B�#�:B�  �!:B�"�#:B�$
�%:B�x �	������ �� �&�#�6�p�?$��?$�F�7N��	7N�
�7N��	7N�

�7N�v�2��	2�
�2��	2�

�2�l�&*�#�	E�
�E�$�E��	E�

�E�R�&*�1-�
�1-�$�1-�
�	1-�hFJ����7B��	,��8�"��
��
�	�$�'�L�$�.EI�F0��F0�6A�F0�	,�F0�P�!��!�	�Z�Z� �� �#r,r)r�r�r2r!)Q�
__future__rr�r�r�r��logging�rerZ�typingrr=�
contextlibr�http.clientr�_HttplibHTTPMessager�_HttplibHTTPResponse�socketrrO�
TYPE_CHECKING�_base_connectionr	�
brotlicffir`�ImportError�	zstandardri�tuple�mapr��search�__version__�groups�
_zstd_version�AttributeErrorr�r�rr�_collectionsr
r�rrr�
exceptionsrrrrrrrrrr�
util.responserr�
util.retryrr�connectionpoolr�	getLoggerr4rHr!r9rLrRr^rgrrrvr�rnr�r7r,r)�<module>r�s���"��	���	�
�
���%�:�<�+�	���4���#���%*��C�����1�4�3C�3C�D�K�K�M�N�%��M�M��w����
�(�(�C�C����=��	����2��g����!��$�$�!�^�!�@��!�.�!�<
�����"���n��*�>��*�$F�F�Rc�r�y�y�c�LH#�#�H#��y�������
�F��� 	��Z�0���D��s=�F�AF)�	F�F�F�F�F&�%F&�)
F7�6F7
© 2025 GrazzMean