Mention socket.gaierror and socket.timeout
This commit is contained in:
parent
cb036f59f6
commit
12c3f5ecc0
15
pep-3151.txt
15
pep-3151.txt
|
@ -47,6 +47,8 @@ of classes, arranged in the following sub-hierarchies::
|
|||
+-- io.BlockingIOError
|
||||
+-- io.UnsupportedOperation (also inherits from ValueError)
|
||||
+-- socket.error
|
||||
+-- socket.gaierror
|
||||
+-- socket.timeout
|
||||
+-- OSError
|
||||
+-- VMSError
|
||||
+-- WindowsError
|
||||
|
@ -222,6 +224,8 @@ become::
|
|||
+-- IOError (replacing OSError, WindowsError, EnvironmentError, etc.)
|
||||
+-- io.BlockingIOError
|
||||
+-- io.UnsupportedOperation (also inherits from ValueError)
|
||||
+-- socket.gaierror
|
||||
+-- socket.timeout
|
||||
|
||||
Justification
|
||||
-------------
|
||||
|
@ -360,8 +364,8 @@ the list of errnos mapped to them, is submitted to discussion:
|
|||
* ``ConnectionResetError``: connection reset by peer (ECONNRESET)
|
||||
|
||||
* ``TimeoutError``: connection timed out (ECONNTIMEOUT); this can be re-cast
|
||||
as a generic timeout exception, useful for other types of timeout (for
|
||||
example in Lock.acquire())
|
||||
as a generic timeout exception, replacing ``socket.timeout`` and also useful
|
||||
for other types of timeout (for example in Lock.acquire())
|
||||
|
||||
In addition, the following exception class are proposed for inclusion:
|
||||
|
||||
|
@ -510,7 +514,12 @@ This PEP also ignores ``SSLError``, which is raised by the ``ssl`` module
|
|||
in order to propagate errors signalled by the ``OpenSSL`` library. Ideally,
|
||||
``SSLError`` would benefit from a similar but separate treatment since it
|
||||
defines its own constants for error types (``ssl.SSL_ERROR_WANT_READ``,
|
||||
etc.).
|
||||
etc.). However, ``SSLError`` should be replaced with ``TimeoutError`` in
|
||||
the case it signals a socket timeout.
|
||||
|
||||
Endly, the fate of ``socket.gaierror`` is not settled. While it would
|
||||
deserve a less cryptic name, this can be handled separately from the
|
||||
exception hierarchy reorganization effort.
|
||||
|
||||
|
||||
.. _Appendix A:
|
||||
|
|
Loading…
Reference in New Issue