From 12c3f5ecc0316b7a10c37e17862f626e9e0e026b Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Wed, 10 Nov 2010 10:01:57 +0000 Subject: [PATCH] Mention socket.gaierror and socket.timeout --- pep-3151.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pep-3151.txt b/pep-3151.txt index 86a0dc45a..748a850c3 100644 --- a/pep-3151.txt +++ b/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: