� ���g�&����ddlmZddlZddlZddlZddlmZddlmZ ej rddl m Z ddl mZddlmZdd lmZGd �d e��ZGd �d e��ZeejdefeedffZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��ZGd�de��Z e Z!Gd�de��Z"Gd�de��Z#Gd�d e��Z$Gd!�d"e��Z%Gd#�d$e%e��Z&Gd%�d&e%��Z'Gd'�d(e'e��Z(Gd)�d*e(��Z)Gd+�d,e��Z*Gd-�d.e��Z+Gd/�d0e��Z,Gd1�d2e-e��Z.Gd3�d4e.��Z/Gd5�d6e.��Z0Gd7�d8e��Z1Gd9�d:e��Z2Gd;�d<e2��Z3Gd=�d>e2��Z4Gd?�d@e2��Z5GdA�dBe2��Z6GdC�dDe��Z7GdE�dFe e-��Z8GdG�dHe��Z9GdI�dJee ��ZGdK�dLee ��Z:GdM�dNe��Z;GdO�dPe<e0��Z=GdQ�dRe-��Z>GdS�dTe��Z?GdU�dVe��Z@dS)W�)� annotationsN)� MessageDefect)�IncompleteRead�)�HTTPConnection)�ConnectionPool)� HTTPResponse)�Retryc��eZdZdZdS)� HTTPErrorz#Base exception used by this module.N��__name__� __module__� __qualname__�__doc__���b/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/urllib3/exceptions.pyr r s������-�-�-�-rr c��eZdZdZdS)� HTTPWarningz!Base warning used by this module.Nr rrrrrs������+�+�+�+rr.c�,��eZdZdZd �fd� Zd d �Z�xZS) � PoolErrorz/Base exception for errors caused within a pool.�poolr�message�str�return�Nonec�p��||_||_t���|�d|����dS�Nz: )r�_message�super�__init__)�selfrr� __class__s �rr"zPoolError.__init__ �=����� ��� � �����D�-�-�G�-�-�.�.�.�.�.r�_TYPE_REDUCE_RESULTc�"�|jd|jffS�N�r$r �r#s r� __reduce__zPoolError.__reduce__%����~��d�m�4�4�4r)rrrrrr�rr&�rrrrr"r+� __classcell__�r$s@rrrsW�������9�9�/�/�/�/�/�/� 5�5�5�5�5�5�5�5rrc�,��eZdZdZd �fd � Zd d �Z�xZS)� RequestErrorz8Base exception for PoolErrors that have associated URLs.rr�urlrrrrc�Z��||_t���||��dSr()r3r!r")r#rr3rr$s �rr"zRequestError.__init__-s*������ ������w�'�'�'�'�'rr&c�.�|jd|j|jffSr()r$r3r r*s rr+zRequestError.__reduce__1s���~��d�h�� �>�>�>r)rrr3rrrrrr-r.r0s@rr2r2*sW�������B�B�(�(�(�(�(�(�?�?�?�?�?�?�?�?rr2c��eZdZdZdS)�SSLErrorz9Raised when SSL certificate fails in an HTTPS connection.Nr rrrr7r76�������C�C�C�Crr7c�0��eZdZUdZded<d �fd � Z�xZS) � ProxyErrorz,Raised when the connection to a proxy fails.� Exception�original_errorrr�errorrrc�Z��t���||��||_dSr()r!r"r<)r#rr=r$s �rr"zProxyError.__init__@s+��� ������%�(�(�(�#����r)rrr=r;rr)rrrr�__annotations__r"r/r0s@rr:r::sS��������6�6�����$�$�$�$�$�$�$�$�$�$rr:c��eZdZdZdS)� DecodeErrorz;Raised when automatic decoding based on Content-Type fails.Nr rrrrArAE�������E�E�E�ErrAc��eZdZdZdS)� ProtocolErrorz>Raised when something unexpected happens mid-request/response.Nr rrrrDrDIs������H�H�H�HrrDc�0��eZdZdZ dd�fd � Zdd �Z�xZS)� MaxRetryErroraRaised when the maximum number of retries is exceeded. :param pool: The connection pool :type pool: :class:`~urllib3.connectionpool.HTTPConnectionPool` :param str url: The requested Url :param reason: The underlying error :type reason: :class:`Exception` Nrrr3r�reason�Exception | Nonerrc�n��||_d|�d|�d�}t���|||��dS)NzMax retries exceeded with url: z (Caused by �))rGr!r")r#rr3rGrr$s �rr"zMaxRetryError.__init___sF����� �P�C�P�P�V�P�P�P�� ������s�G�,�,�,�,�,rr&c�.�|jd|j|jffSr()r$r3rGr*s rr+zMaxRetryError.__reduce__hs���~��d�h�� �<�<�<rr()rrr3rrGrHrrr-r.r0s@rrFrFTsg���������JN�-�-�-�-�-�-�-�=�=�=�=�=�=�=�=rrFc�(��eZdZdZ d d �fd � Z�xZS)�HostChangedErrorz?Raised when an existing pool gets a request for a foreign host.�rrr3r�retries� Retry | intrrc�f��d|��}t���|||��||_dS)Nz'Tried to open a foreign host with url: )r!r"rO)r#rr3rOrr$s �rr"zHostChangedError.__init__ps:���B�C�A�A�� ������s�G�,�,�,��� � � r)rN)rrr3rrOrPrr�rrrrr"r/r0s@rrMrMmsO�������I�I�FG�����������rrMc��eZdZdZdS)�TimeoutStateErrorz1Raised when passing an invalid state to a timeoutNr rrrrTrTxs������;�;�;�;rrTc��eZdZdZdS)� TimeoutErrorz�Raised when a socket timeout error occurs. Catching this error will catch both :exc:`ReadTimeoutErrors <ReadTimeoutError>` and :exc:`ConnectTimeoutErrors <ConnectTimeoutError>`. Nr rrrrVrV|s���������rrVc��eZdZdZdS)�ReadTimeoutErrorzFRaised when a socket timeout occurs while receiving data from a serverNr rrrrXrX�s������P�P�P�PrrXc��eZdZdZdS)�ConnectTimeoutErrorz@Raised when a socket timeout occurs while connecting to a serverNr rrrrZrZ�s������J�J�J�JrrZc�D��eZdZdZd �fd� Zd d �Zedd ���Z�xZS)�NewConnectionErrorzHRaised when we fail to establish a new connection. Usually ECONNREFUSED.�connrrrrrc�p��||_||_t���|�d|����dSr)r]r r!r")r#r]rr$s �rr"zNewConnectionError.__init__�r%rr&c�"�|jd|jffSr(r)r*s rr+zNewConnectionError.__reduce__�r,rc�H�tjdtd���|jS)Nz\The 'pool' property is deprecated and will be removed in urllib3 v2.1.0. Use 'conn' instead.�)� stacklevel)�warnings�warn�DeprecationWarningr]r*s rrzNewConnectionError.pool�s0��� � 5� ��  � � � ��y�r)r]rrrrrr-)rr) rrrrr"r+�propertyrr/r0s@rr\r\�sw�������R�R�/�/�/�/�/�/� 5�5�5�5������X�����rr\c�,��eZdZdZd �fd� Zd d �Z�xZS)�NameResolutionErrorz'Raised when host name resolution fails.�hostrr]rrG�socket.gaierrorc�z��d|�d|�d�}||_||_t���||��dS)NzFailed to resolve 'z' (rJ)�_host�_reasonr!r")r#rir]rGrr$s �rr"zNameResolutionError.__init__�sI���:��:�:��:�:�:���� ��� � ������w�'�'�'�'�'rrr&c�.�|j|jd|jffSr()r$rlrmr*s rr+zNameResolutionError.__reduce__�s���~�� �D�$�,�?�?�?r)rirr]rrGrjr-r.r0s@rrhrh�s_�������1�1�(�(�(�(�(�(� @�@�@�@�@�@�@�@rrhc��eZdZdZdS)�EmptyPoolErrorzCRaised when a pool runs out of connections and no more are allowed.Nr rrrrprp��������M�M�M�Mrrpc��eZdZdZdS)� FullPoolErrorzGRaised when we try to add a connection to a full pool in blocking mode.Nr rrrrsrs�s������Q�Q�Q�Qrrsc��eZdZdZdS)�ClosedPoolErrorzCRaised when a request enters a pool after the pool has been closed.Nr rrrruru�rqrruc��eZdZdZdS)�LocationValueErrorz<Raised when there is something wrong with a given URL input.Nr rrrrwrw�s������F�F�F�Frrwc�$��eZdZdZd�fd� Z�xZS)�LocationParseErrorz=Raised when get_host or similar fails to parse the URL input.�locationrrrc�b��d|��}t���|��||_dS)NzFailed to parse: )r!r"rz)r#rzrr$s �rr"zLocationParseError.__init__�s3���0�h�0�0�� ������!�!�!� �� � � r)rzrrrrRr0s@rryry�sC�������G�G�!�!�!�!�!�!�!�!�!�!rryc�$��eZdZdZd�fd� Z�xZS)�URLSchemeUnknownz2Raised when a URL input has an unsupported scheme.�schemerc�b��d|��}t���|��||_dS)NzNot supported URL scheme )r!r"r~�r#r~rr$s �rr"zURLSchemeUnknown.__init__�s3���6�f�6�6�� ������!�!�!��� � � r)r~rrRr0s@rr}r}�sC�������<�<����������rr}c��eZdZdZdZdZdS)� ResponseErrorzDUsed as a container for an error reason supplied in a MaxRetryError.ztoo many error responsesz&too many {status_code} error responsesN)rrrr� GENERIC_ERROR�SPECIFIC_ERRORrrrr�r��s������N�N�.�M�=�N�N�Nrr�c��eZdZdZdS)�SecurityWarningz0Warned when performing security reducing actionsNr rrrr�r���������:�:�:�:rr�c��eZdZdZdS)�InsecureRequestWarningz/Warned when making an unverified HTTPS request.Nr rrrr�r��s������9�9�9�9rr�c��eZdZdZdS)�NotOpenSSLWarningz)Warned when using unsupported SSL libraryNr rrrr�r��s������3�3�3�3rr�c��eZdZdZdS)�SystemTimeWarningz0Warned when system time is suspected to be wrongNr rrrr�r��r�rr�c��eZdZdZdS)�InsecurePlatformWarningzIWarned when certain TLS/SSL configuration is not available on a platform.Nr rrrr�r��s������S�S�S�Srr�c��eZdZdZdS)�DependencyWarningzc Warned when an attempt is made to import a module with missing optional dependencies. Nr rrrr�r������������rr�c��eZdZdZdS)�ResponseNotChunkedz;Response needs to be chunked in order to read it as chunks.Nr rrrr�r��rBrr�c��eZdZdZdS)�BodyNotHttplibCompatiblez� Body should be :class:`http.client.HTTPResponse` like (have an fp attribute which returns raw chunks) for read_chunked(). Nr rrrr�r��r�rr�c�8�eZdZUdZded<ded<d d�Zd d �Zd S) rz� Response length doesn't match expected Content-Length Subclass of :class:`http.client.IncompleteRead` to allow int value for ``partial`` to avoid creating large objects on streamed reads. �int�partial�expectedrrc�"�||_||_dSr(�r�r�)r#r�r�s rr"zIncompleteRead.__init__s���� � �� � � rrc�$�d|j|jfzS)Nz/IncompleteRead(%i bytes read, %i more expected)r�r*s r�__repr__zIncompleteRead.__repr__s��@� �L� �M�D � � rN)r�r�r�r�rr�rr)rrrrr?r"r�rrrrrs\����������L�L�L��M�M�M�!�!�!�!� � � � � � rrc�"�eZdZdZd d�Zd d �Zd S)�InvalidChunkLengthz+Invalid chunk length in a chunked response.�responser �length�bytesrrc�l�|���|_|j|_||_||_dSr()�tellr��length_remainingr�r�r�)r#r�r�s rr"zInvalidChunkLength.__init__s-��$�M�M�O�O�� �$,�$=�� � �� ��� � � rrc�$�d|j|jfzS)Nz0InvalidChunkLength(got length %r, %i bytes read))r�r�r*s rr�zInvalidChunkLength.__repr__$s��A� �K� �L�E � � rN)r�r r�r�rrr�)rrrrr"r�rrrr�r�sB������5�5�����  � � � � � rr�c��eZdZdZdS)� InvalidHeaderz(The header provided was somehow invalid.Nr rrrr�r�+s������2�2�2�2rr�c�$��eZdZdZd�fd� Z�xZS)�ProxySchemeUnknownz1ProxyManager does not support the supplied schemer~� str | Nonerrc�p��|dkrd}|�d}nd|�d�}t���|��dS)N� localhostz>Proxy URL had no scheme, should start with http:// or https://z!Proxy URL had unsupported scheme z , should use http:// or https://�r!r"r�s �rr"zProxySchemeUnknown.__init__4sO��� �[� � ��F� �>�V�G�G�b�&�b�b�b�G� ������!�!�!�!�!r)r~r�rrrRr0s@rr�r�/sC�������;�;� "� "� "� "� "� "� "� "� "� "rr�c��eZdZdZdS)�ProxySchemeUnsupportedz=Fetching HTTPS resources through HTTPS proxies is unsupportedNr rrrr�r�@s������G�G�G�Grr�c�$��eZdZdZd �fd� Z�xZS) �HeaderParsingErrorzNRaised by assert_header_parsing, but we convert it to a log.warning statement.�defects�list[MessageDefect]� unparsed_data�bytes | str | Nonerrc�\��|pd�d|��}t���|��dS)N�Unknownz, unparsed data: r�)r#r�r�rr$s �rr"zHeaderParsingError.__init__Gs;����)� �M�M�M�M�M�� ������!�!�!�!�!r)r�r�r�r�rrrRr0s@rr�r�DsC�������X�X�"�"�"�"�"�"�"�"�"�"rr�c��eZdZdZdS)�UnrewindableBodyErrorz9urllib3 encountered an error when trying to rewind a bodyNr rrrr�r�Nr8rr�)A� __future__r�socket�typingrc� email.errorsr� http.clientr�httplib_IncompleteRead� TYPE_CHECKING� connectionr�connectionpoolrr�r � util.retryr r;r �Warningr�tuple�Callable�objectr&rr2r7r:rArD�ConnectionErrorrFrMrTrVrXrZr\rhrprsru� ValueErrorrwryr}r�r�r�r�r�r�r�r�r�r�r��AssertionErrorr�r�r�r�rrr�<module>r�s���"�"�"�"�"�"� � � � � � � � �����&�&�&�&�&�&�@�@�@�@�@�@� ��"�*�*�*�*�*�*�.�.�.�.�.�.�&�&�&�&�&�&�!�!�!�!�!�!� .�.�.�.�.� �.�.�.�,�,�,�,�,�'�,�,�,��F�O�C��K�8�%��� �:L�L�M�� 5� 5� 5� 5� 5� � 5� 5� 5� ?� ?� ?� ?� ?�9� ?� ?� ?�D�D�D�D�D�y�D�D�D�$�$�$�$�$��$�$�$�F�F�F�F�F�)�F�F�F�I�I�I�I�I�I�I�I�I�  �� =�=�=�=�=�L�=�=�=�2�����|����<�<�<�<�<� �<�<�<������9����Q�Q�Q�Q�Q�|�\�Q�Q�Q� K�K�K�K�K�,�K�K�K������,�i����0 @� @� @� @� @�,� @� @� @�N�N�N�N�N�Y�N�N�N�R�R�R�R�R�I�R�R�R�N�N�N�N�N�i�N�N�N�G�G�G�G�G��Y�G�G�G�!�!�!�!�!�+�!�!�!������)����>�>�>�>�>�I�>�>�>�;�;�;�;�;�k�;�;�;�:�:�:�:�:�_�:�:�:�4�4�4�4�4��4�4�4�;�;�;�;�;��;�;�;�T�T�T�T�T�o�T�T�T������ ����F�F�F�F�F�� �F�F�F������y���� � � � � �Y� 6� � � �,  �  �  �  �  ��$:�  �  �  � 3�3�3�3�3�I�3�3�3�"�"�"�"�"��)9�"�"�"�"H�H�H�H�H�Z�H�H�H�"�"�"�"�"��"�"�"�D�D�D�D�D�I�D�D�D�D�Dr
Memory