Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
exceptions.cpython-313.pyc210 linesDownload Raw Back to __pycache__
1�

2p�j4���SrSSKJr SSKrSSKJr /SQr"SS\5r"S	S3\5r	"SS\	5r4"S
S\	5r"SS\5r"SS\5r
"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS\5r"SS \5r"S!S"\5r"S#S$\5r"S%S&\5r"S'S(\5r"S)S*\5r"S+S,\5r"S-S.\5r"S/S0\5r"S1S2\5r"S3S4\5r"S5S6\5r"S7S8\\ 5r!"S9S:\\"5r#SS;K$J%r%J&r& \"\'"5S<S<S<S<S=.S>9 g)?aU5:mod:`websockets.exceptions` defines the following hierarchy of exceptions.6 7* :exc:`WebSocketException`8    * :exc:`ConnectionClosed`9        * :exc:`ConnectionClosedOK`10        * :exc:`ConnectionClosedError`11    * :exc:`InvalidURI`12    * :exc:`InvalidProxy`13    * :exc:`InvalidHandshake`14        * :exc:`SecurityError`15        * :exc:`ProxyError`16            * :exc:`InvalidProxyMessage`17            * :exc:`InvalidProxyStatus`18        * :exc:`InvalidMessage`19        * :exc:`InvalidStatus`20        * :exc:`InvalidStatusCode` (legacy)21        * :exc:`InvalidHeader`22            * :exc:`InvalidHeaderFormat`23            * :exc:`InvalidHeaderValue`24            * :exc:`InvalidOrigin`25            * :exc:`InvalidUpgrade`26        * :exc:`NegotiationError`27            * :exc:`DuplicateParameter`28            * :exc:`InvalidParameterName`29            * :exc:`InvalidParameterValue`30        * :exc:`AbortHandshake` (legacy)31        * :exc:`RedirectHandshake` (legacy)32    * :exc:`ProtocolError` (Sans-I/O)33    * :exc:`PayloadTooBig` (Sans-I/O)34    * :exc:`InvalidState` (Sans-I/O)35    * :exc:`ConcurrencyError`36 37�)�annotationsN�)�lazy_import)�WebSocketException�ConnectionClosed�ConnectionClosedOK�ConnectionClosedError�38InvalidURI�InvalidProxy�InvalidHandshake�
SecurityError�39ProxyError�InvalidProxyMessage�InvalidProxyStatus�InvalidMessage�
InvalidStatus�
InvalidHeader�InvalidHeaderFormat�InvalidHeaderValue�
InvalidOrigin�InvalidUpgrade�NegotiationError�DuplicateParameter�InvalidParameterName�InvalidParameterValue�
ProtocolError�
PayloadTooBig�InvalidState�ConcurrencyErrorc��\rSrSrSrSrg)r�Iz740Base class for all exceptions defined by websockets.41 42�N��__name__�43__module__�__qualname__�__firstlineno__�__doc__�__static_attributes__r"��[D:\code\apps\devtools\python\user_packages\Python313\site-packages\websockets/exceptions.pyrrI���r*rc�h�\rSrSrSrS	S44SjjrSSjr\SSj5r\SSj5r	Sr45g)
r�Pa�46Raised when trying to interact with a closed connection.47 48Attributes:49    rcvd: If a close frame was received, its code and reason are available50        in ``rcvd.code`` and ``rcvd.reason``.51    sent: If a close frame was sent, its code and reason are available52        in ``sent.code`` and ``sent.reason``.53    rcvd_then_sent: If close frames were received and sent, this attribute54        tells in which order this happened, from the perspective of this55        side of the connection.56 57Nc��XlX lX0lURSLURSL=(d URSL:Xdeg�N��rcvd�sent�rcvd_then_sent)�selfr2r3r4s    r+�__init__�ConnectionClosed.__init___sE���	��	�,���#�#�t�+����d�1B�1W�d�i�i�SW�FW�X�X�Xr*c�$�URcURcgSURS3$URcSURS3$UR(aSURSUR3$SURSUR3$)Nzno close frame received or sentzsent z; no close frame receivedz	received z; no close frame sentz; then sent z; then received r1�r5s r+�__str__�ConnectionClosed.__str__js����9�9���y�y� �8��t�y�y�k�)B�C�C��y�y� �"�4�9�9�+�-B�C�C��&�&�&�t�y�y�k��d�i�i�[�I�I�"�4�9�9�+�-=�d�i�i�[�I�Ir*c��[R"S[5 URc[R58R$URR$)NzZConnectionClosed.code is deprecated; use Protocol.close_code or ConnectionClosed.rcvd.code)�warnings�warn�DeprecationWarningr2�frames�	CloseCode�ABNORMAL_CLOSURE�coder9s r+rC�ConnectionClosed.code{sC���
�
�
D��	59�60�9�9���#�#�4�4�4��y�y�~�~�r*c��[R"S[5 URcgURR$)Nz`ConnectionClosed.reason is deprecated; use Protocol.close_reason or ConnectionClosed.rcvd.reason�)r=r>r?r2�reasonr9s r+rG�ConnectionClosed.reason�s6���
�
�
H��	61�62�9�9����y�y���r*)r2r4r3r0)r2�frames.Close | Noner3rIr4zbool | None�return�None�rJ�str)rJ�int)r$r%r&r'r(r6r:�propertyrCrGr)r"r*r+rrPsj���$'+�		Y�!�	Y�"�	Y�$�		Y�6364�	Y�
J�"����� �� r*rc��\rSrSrSrSrg)r�z�65Like :exc:`ConnectionClosed`, when the connection terminated properly.66 67A close code with code 1000 (OK) or 1001 (going away) or without a code was68received and sent.69 70r"Nr#r"r*r+rr����r*rc��\rSrSrSrSrg)r	�z�71Like :exc:`ConnectionClosed`, when the connection terminated with an error.72 73A close frame with a code other than 1000 (OK) or 1001 (going away) was74received or sent, or the closing handshake didn't complete properly.75 76r"Nr#r"r*r+r	r	�rRr*r	c�,�\rSrSrSrSSjrSSjrSrg)	r77�zD78Raised when connecting to a URI that isn't a valid WebSocket URI.79 80c��XlX lgr0��uri�msg)r5rYrZs   r+r6�InvalidURI.__init__�s�����r*c�8�URSUR3$)Nz isn't a valid URI: rXr9s r+r:�InvalidURI.__str__�s���(�(��/����z�:�:r*)rZrYN)rYrMrZrMrJrKrL�r$r%r&r'r(r6r:r)r"r*r+r81r82�s���83�;r*r84c�,�\rSrSrSrSSjrSSjrSrg)	r�z785Raised when connecting via a proxy that isn't valid.86 87c��XlX lgr0��proxyrZ)r5rcrZs   r+r6�InvalidProxy.__init__�s���88��r*c�8�URSUR3$)Nz isn't a valid proxy: rbr9s r+r:�InvalidProxy.__str__�s���*�*��3�D�H�H�:�>�>r*)rZrcN)rcrMrZrMrJrKrLr^r"r*r+rr�s���89�?r*rc��\rSrSrSrSrg)r��zE90Base class for exceptions raised when the opening handshake fails.91 92r"Nr#r"r*r+rr�r,r*rc��\rSrSrSrSrg)r
��z�93Raised when a handshake request or response breaks a security rule.94 95Security limits can be configured with :doc:`environment variables96<../reference/variables>`.97 98r"Nr#r"r*r+r
r
�rRr*r
c��\rSrSrSrSrg)r��z-99Raised when failing to connect to a proxy.100 101r"Nr#r"r*r+rr�r,r*rc��\rSrSrSrSrg)r��z3102Raised when an HTTP proxy response is malformed.103 104r"Nr#r"r*r+rr�r,r*rc�,�\rSrSrSrSSjrSSjrSrg)	r��z4105Raised when an HTTP proxy rejects the connection.106 107c��Xlgr0��response�r5rss  r+r6�InvalidProxyStatus.__init__���� �
r*c�6�SURRS3$)Nz proxy rejected connection: HTTP �d�rs�status_coder9s r+r:�InvalidProxyStatus.__str__�s��1�$�-�-�2K�2K�A�1N�O�Or*rrN�rszhttp11.ResponserJrKrLr^r"r*r+rr�s���108!�Pr*rc��\rSrSrSrSrg)r��z<109Raised when a handshake request or response is malformed.110 111r"Nr#r"r*r+rr�r,r*rc�,�\rSrSrSrSSjrSSjrSrg)	r��zB112Raised when a handshake response rejects the WebSocket upgrade.113 114c��Xlgr0rrrts  r+r6�InvalidStatus.__init__�rvr*c�6�SURRS3$)Nz+server rejected WebSocket connection: HTTP rxryr9s r+r:�InvalidStatus.__str__�s��9�$�-�-�:S�:S�TU�9V�W�	115r*rrNr|rLr^r"r*r+rr�s���116!�117r*rc�0�\rSrSrSrSSSjjrS	SjrSrg)118rizC119Raised when an HTTP header doesn't have a valid format or value.120 121Nc��XlX lgr0��name�value�r5r�r�s   r+r6�InvalidHeader.__init__122����	��123r*c��URcSURS3$URS:XaSURS3$SURSUR3$)Nzmissing z headerrFzempty zinvalid z	 header: �r�r�r9s r+r:�InvalidHeader.__str__sY���:�:���d�i�i�[��0�0�
�Z�Z�2�
��D�I�I�;�g�.�.��d�i�i�[�	�$�*�*��>�>r*r�r0�r�rMr��124str | NonerJrKrLr^r"r*r+rrs���125�?r*rc�0^�\rSrSrSrSU4SjjrSrU=r$)rizt126Raised when an HTTP header cannot be parsed.127 128The format of the header doesn't match the grammar for that header.129 130c�4>�[TU]XSUSU35 g)Nz at z in ��superr6)r5r��error�header�pos�	__class__s     �r+r6�InvalidHeaderFormat.__init__s!���
������S�E��f�X�>�?r*r")131r�rMr�rMr�rMr�rNrJrK�r$r%r&r'r(r6r)�
__classcell__�r�s@r+rrs����@�@r*rc��\rSrSrSrSrg)ri#zu132Raised when an HTTP header has a wrong value.133 134The format of the header is correct but the value isn't acceptable.135 136r"Nr#r"r*r+rr#s��r*rc�0^�\rSrSrSrSU4SjjrSrU=r$)ri,z<137Raised when the Origin header in a request isn't allowed.138 139c�&>�[TU]SU5 g)N�Originr�)r5�originr�s  �r+r6�InvalidOrigin.__init__2s���
����6�*r*r")r�r�rJrKr�r�s@r+rr,s����140+�+r*rc��\rSrSrSrSrg)ri6z>141Raised when the Upgrade or Connection header isn't correct.142 143r"Nr#r"r*r+rr6r,r*rc��\rSrSrSrSrg)ri=z?144Raised when negotiating an extension or a subprotocol fails.145 146r"Nr#r"r*r+rr=r,r*rc�,�\rSrSrSrSSjrSSjrSrg)	riDzC147Raised when a parameter name is repeated in an extension header.148 149c��Xlgr0�r��r5r�s  r+r6�DuplicateParameter.__init__J����	r*c� �SUR3$)Nzduplicate parameter: r�r9s r+r:�DuplicateParameter.__str__Ms��&�t�y�y�k�2�2r*r�N�r�rMrJrKrLr^r"r*r+rrDs���150�3r*rc�,�\rSrSrSrSSjrSSjrSrg)	riQzB151Raised when a parameter name in an extension header is invalid.152 153c��Xlgr0r�r�s  r+r6�InvalidParameterName.__init__Wr�r*c� �SUR3$)Nzinvalid parameter name: r�r9s r+r:�InvalidParameterName.__str__Zs��)�$�)�)��5�5r*r�Nr�rLr^r"r*r+rrQs���154�6r*rc�,�\rSrSrSrSSjrSSjrSrg)	ri^zC155Raised when a parameter value in an extension header is invalid.156 157c��XlX lgr0r�r�s   r+r6�InvalidParameterValue.__init__dr�r*c��URcSUR3$URS:XaSUR3$SURSUR3$)Nzmissing value for parameter rFzempty value for parameter zinvalid value for parameter z: r�r9s r+r:�InvalidParameterValue.__str__hsU���:�:��1�$�)�)��=�=�
�Z�Z�2�
�/��	�	�{�;�;�1�$�)�)��B�t�z�z�l�K�Kr*r�Nr�rLr^r"r*r+rr^s���158�Lr*rc��\rSrSrSrSrg)riqz�159Raised when receiving or sending a frame that breaks the protocol.160 161The Sans-I/O implementation raises this exception when:162 163* receiving or sending a frame that contains invalid data;164* receiving or sending an invalid sequence of frames.165 166r"Nr#r"r*r+rrqs��r*rc�L�\rSrSrSrSS	SjjrS167SjrSSjrSrg)ri}a=168Raised when parsing a frame with a payload that exceeds the maximum size.169 170The Sans-I/O layer uses this exception internally. It doesn't bubble up to171the I/O layer.172 173The :meth:`~websockets.extensions.Extension.decode` method of extensions174must raise :exc:`PayloadTooBig` if decoding a frame would exceed the limit.175 176Nc���[U[5(a,UbeUbe[R"S[5 XlgSUlXlUceX lSUlURU5 g)NzMPayloadTooBig(message) is deprecated; change to PayloadTooBig(size, max_size))177�178isinstancerMr=r>r?�message�size�max_size�current_size�set_current_size)r5�size_or_messager�r�s    r+r6�PayloadTooBig.__init__�sw���o�s�+�+��#�#�#��'�'�'��M�M�:�"�
�179(7�L��D�L�$3�I��'�'�'�!)�M�,0�D���!�!�,�/r*c���URbUR$SnURbUSURS3-
nURbUSURS3-
nUSURS3-
nU$)Nzframe zwith z bytes zafter reading zexceeds limit of z bytes)r�r�r�r�)r5r�s  r+r:�PayloadTooBig.__str__�s���<�<�#��<�<���G��y�y�$��U�4�9�9�+�W�5�5��� � �,��^�D�,=�,=�+>�g�F�F���*�4�=�=�/��@�@�G��Nr*c�`�URbeUbU=RU-
slXlggr0)r�r�)r5r�s  r+r��PayloadTooBig.set_current_size�s3��� � �(�(�(��#��M�M�\�)�M� ,��$r*)r�r�r�r�)NN)r�zint | None | strr��180int | Noner�r�rJrKrL)r�r�rJrK)	r$r%r&r'r(r6r:r�r)r"r*r+rr}sD��	� $�#'�	0�)�0��0�!�	0�181182�0�.183�-r*rc��\rSrSrSrSrg)ri�a~184Raised when sending a frame is forbidden in the current state.185 186Specifically, the Sans-I/O layer raises this exception when:187 188* sending a data frame to a connection in a state other189  :attr:`~websockets.protocol.State.OPEN`;190* sending a control frame to a connection in a state other than191  :attr:`~websockets.protocol.State.OPEN` or192  :attr:`~websockets.protocol.State.CLOSING`.193 194r"Nr#r"r*r+rr�s��r*rc��\rSrSrSrSrg)ri�z�195Raised when receiving or sending messages concurrently.196 197WebSocket is a connection-oriented protocol. Reads must be serialized; so198must be writes. However, reading and writing concurrently is possible.199 200r"Nr#r"r*r+rr�rRr*r)r@�http11z.legacy.exceptions)�AbortHandshake�InvalidStatusCode�RedirectHandshake�WebSocketProtocolError)�deprecated_aliases)(r(�201__future__rr=�importsr�__all__�	Exceptionrrrr	r202rrr
rrrrrrrrrrrrrrrr�AssertionErrorr�RuntimeErrorrrFr@r��globalsr"r*r+�<module>r�s���!�F#�� ���<���? �)�? �D�)���,��;�#�;�?�%�?��)���$���!���*��203P��204P��%��205�$�206�?�$�?�&	@�-�	@����+�M�+��]���'��2073�)�2083�2096�+�2106�L�,�L�&	�&�	�3-�&�3-�l�%�~���)�<�����I�/�1�1�"6��	r*
codekingpro/portable-devtools · Team Ai