[Python-checkins] r86394 - peps/trunk/pep-3151.txt

antoine.pitrou python-checkins at python.org
Wed Nov 10 11:01:57 CET 2010


Author: antoine.pitrou
Date: Wed Nov 10 11:01:57 2010
New Revision: 86394

Log:
Mention socket.gaierror and socket.timeout



Modified:
   peps/trunk/pep-3151.txt

Modified: peps/trunk/pep-3151.txt
==============================================================================
--- peps/trunk/pep-3151.txt	(original)
+++ peps/trunk/pep-3151.txt	Wed Nov 10 11:01:57 2010
@@ -47,6 +47,8 @@
             +-- io.BlockingIOError
             +-- io.UnsupportedOperation (also inherits from ValueError)
             +-- socket.error
+                +-- socket.gaierror
+                +-- socket.timeout
         +-- OSError
             +-- VMSError
             +-- WindowsError
@@ -222,6 +224,8 @@
     +-- IOError   (replacing OSError, WindowsError, EnvironmentError, etc.)
         +-- io.BlockingIOError
         +-- io.UnsupportedOperation (also inherits from ValueError)
+        +-- socket.gaierror
+        +-- socket.timeout
 
 Justification
 -------------
@@ -360,8 +364,8 @@
 * ``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 @@
 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:


More information about the Python-checkins mailing list