https://t.me/RX1948
Server : nginx/1.24.0
System : Linux ip-172-31-33-48 6.14.0-1011-aws #11~24.04.1-Ubuntu SMP Fri Aug 1 02:07:25 UTC 2025 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
Directory :  /lib/python3/dist-packages/botocore/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/botocore/__pycache__/response.cpython-312.pyc
�

P��e;���ddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
mZmZddlmZdd	l
mZdd
lmZej&e�ZGd�de�Zd
�Zy)�N)�IOBase)�
ProtocolError)�ReadTimeoutError)�parsers)�set_socket_timeout)�IncompleteReadErrorr�ResponseStreamingError)�ScalarTypes)�
XMLParseError)�first_non_none_responsec�~�eZdZdZdZd�Zd�Zd�Zd�Zdd�Z	d	�Z
d
�Zd�Zd�Z
d
�ZeZedfd�Zefd�Zd�Zd�Zd�Zy)�
StreamingBodyaeWrapper class for an http response body.

    This provides a few additional conveniences that do not exist
    in the urllib3 model:

        * Set the timeout on the socket (i.e read() timeouts)
        * Auto validation of content length, if the amount of bytes
          we read does not match the content length, an exception
          is raised.

    ic�.�||_||_d|_y)Nr)�_raw_stream�_content_length�_amount_read)�self�
raw_stream�content_lengths   �3/usr/lib/python3/dist-packages/botocore/response.py�__init__zStreamingBody.__init__5s��%���-������c��y�N��rs r�__del__zStreamingBody.__del__:s��	
rc�|�	t|j|�y#t$rtj	dd���wxYw)z&Set the timeout seconds on the socket.zbCannot access the socket object of a streaming response.  It's possible the interface has changed.T)�exc_infoN)rr�AttributeError�logger�error)r�timeouts  rrz StreamingBody.set_socket_timeout@sF��		��t�/�/��9���	��L�L�-��	
�
�
�	�s��";c�V�	|jj�S#t$rYywxYw)NF)r�readabler rs rr%zStreamingBody.readableWs.��	��#�#�,�,�.�.���	��	�s��	(�(Nc�,�	|jj|�}|xjt|�z
c_|�|s|dkDr|j�|S#t$r}t|j|���d}~wt
$r}t
|���d}~wwxYw)zhRead at most amt bytes from the stream.

        If the amt argument is omitted, read all data.
        )�endpoint_urlr"N)r"r)
r�read�URLLib3ReadTimeoutErrorr�url�URLLib3ProtocolErrorr	r�len�_verify_content_length)r�amt�chunk�es    rr(zStreamingBody.read]s���
	2��$�$�)�)�#�.�E�	
���S��Z�'���;�u��q��
�'�'�)����'�	@�"����Q�?�?��#�	2�(�q�1�1��	2�s#�A�	B�A6�6B�B�Bc�6�|jj�Sr)r�	readlinesrs rr2zStreamingBody.readlinesqs�����)�)�+�+rc�8�|j|j�S)z:Return an iterator to yield 1k chunks from the raw stream.)�iter_chunks�_DEFAULT_CHUNK_SIZErs r�__iter__zStreamingBody.__iter__ts������ 8� 8�9�9rc�T�|j|j�}|r|St��)z-Return the next 1k chunk from the raw stream.)r(r5�
StopIteration)r�
current_chunks  r�__next__zStreamingBody.__next__xs'���	�	�$�":�":�;�
�� � ��o�rc��|jSr)rrs r�	__enter__zStreamingBody.__enter__s�����rc�8�|jj�yr�r�close)r�type�value�	tracebacks    r�__exit__zStreamingBody.__exit__�s������� rFc#��K�d}|j|�D];}||zjd�}|ddD]}|j|�d���|d}�=|r|j|�d��yy�w)z�Return an iterator to yield lines from the raw stream.

        This is achieved by reading chunk of bytes (of size chunk_size) at a
        time from the raw stream, and then yielding lines from there.
        rTN���r)r4�
splitlines)r�
chunk_size�keepends�pendingr/�lines�lines       r�
iter_lineszStreamingBody.iter_lines�s��������%�%�j�1�	 �E��u�_�0�0��6�E��c�r�
�
3���o�o�h�/��2�2�
3��B�i�G�		 �
��$�$�X�.�q�1�1��s�A,A.c#�DK�	|j|�}|dk(ry|����w)z\Return an iterator to yield chunks of chunk_size bytes from the raw
        stream.
        rN)r()rrGr9s   rr4zStreamingBody.iter_chunks�s/����� �I�I�j�1�M���#����	�s� c��|j�M|jt|j�k7r*t|jt|j����yy)N)�actual_bytes�expected_bytes)rr�intrrs rr-z$StreamingBody._verify_content_length�s\�����+��0A�0A�S�� � �F
�1
�&�!�.�.�"�4�#7�#7�8��
�1
�+rc�6�|jj�Sr)r�tellrs rrSzStreamingBody.tell�s�����$�$�&�&rc�8�|jj�y)z*Close the underlying http response stream.Nr>rs rr?zStreamingBody.close�s������� rr)�__name__�
__module__�__qualname__�__doc__r5rrrr%r(r2r6r:r<rC�nextrLr4r-rSr?rrrrr&sk��
����

��.��(,�:�� �!��D�$7�%�
2�&9� �
�'�!rrc�v�|jd}|j|jd�}|ddk\r|j|d<nG|jr,t|j|djd��|d<n|j|d<tj|�}||j||j�fS)N�protocol)�headers�status_coder]i,�bodyr\zcontent-length)�metadatar\r]�content�has_streaming_outputr�raw�getr�
create_parser�parse�output_shape)�operation_model�
http_responser[�
response_dict�parsers     r�get_responserk�s����'�'�
�3�H� �(�(�$�0�0��M��]�#�s�*� -� 5� 5�
�f��	�	-�	-� -����}�Y�7�;�;�<L�M�!
�
�f��!.� 5� 5�
�f��
�
"�
"�8�
,�F��&�,�,���3�3���r)�logging�ior�urllib3.exceptionsrr+rr)�botocorer�botocore.compatr�botocore.exceptionsrr	r
r�botocore.hooksr�	getLoggerrUr!rrkrrr�<module>rtsV����D�J��.���!�)�2�
��	�	�8�	$��K!�F�K!�\r

https://t.me/RX1948 - 2025