Commits

Antoine Pitrou  committed 5030889

Mention socket.gaierror and socket.timeout

  • Participants
  • Parent commits 2b039ca

Comments (0)

Files changed (1)

File pep-3151.txt

             +-- io.BlockingIOError
             +-- io.UnsupportedOperation (also inherits from ValueError)
             +-- socket.error
+                +-- socket.gaierror
+                +-- socket.timeout
         +-- OSError
             +-- VMSError
             +-- WindowsError
     +-- IOError   (replacing OSError, WindowsError, EnvironmentError, etc.)
         +-- io.BlockingIOError
         +-- io.UnsupportedOperation (also inherits from ValueError)
+        +-- socket.gaierror
+        +-- socket.timeout
 
 Justification
 -------------
 * ``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:
 
 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: