[Python-checkins] peps: Mapping EBADF is not very useful (as pointed out by Nick)

antoine.pitrou python-checkins at python.org
Wed Jul 27 00:51:43 CEST 2011


http://hg.python.org/peps/rev/0f4664ccb5a2
changeset: 3912:0f4664ccb5a2
user: Antoine Pitrou <solipsis at pitrou.net>
date: Wed Jul 27 00:43:27 2011 +0200
summary:
 Mapping EBADF is not very useful (as pointed out by Nick)
files:
 pep-3151.txt | 11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/pep-3151.txt b/pep-3151.txt
--- a/pep-3151.txt
+++ b/pep-3151.txt
@@ -335,14 +335,14 @@
 `Step 1`_ is a loose prerequisite for this.
 
 Prerequisite, because some errnos can currently be attached to different
-exception classes: for example, EBADF can be attached to both OSError and
+exception classes: for example, ENOENT can be attached to both OSError and
 IOError, depending on the context. If we don't want to break *useful
 compatibility*, we can't make an ``except OSError`` (or IOError) fail to
 match an exception where it would succeed today.
 
 Loose, because we could decide for a partial resolution of step 2
-if existing exception classes are not coalesced: for example, EBADF could
-raise a hypothetical BadFileDescriptor where an IOError was previously
+if existing exception classes are not coalesced: for example, ENOENT could
+raise a hypothetical FileNotFoundError where an IOError was previously
 raised, but continue to raise OSError otherwise.
 
 The dependency on step 1 could be totally removed if the new subclasses
@@ -376,10 +376,6 @@
 for non-blocking operation (EAGAIN, EALREADY, EWOULDBLOCK, EINPROGRESS);
 this is the existing ``io.BlockingIOError`` with an extended role
 
-* ``FileDescriptorError``: operation on an invalid file descriptor (EBADF);
- the default error message could point out that most causes are that
- an existing file descriptor has been closed
-
 * ``ConnectionAbortedError``: connection attempt aborted by peer (ECONNABORTED)
 
 * ``ConnectionRefusedError``: connection reset by peer (ECONNREFUSED)
@@ -408,7 +404,6 @@
 +-- ConnectionAbortedError ECONNABORTED
 +-- ConnectionRefusedError ECONNREFUSED
 +-- ConnectionResetError ECONNRESET
- +-- FileDescriptorError EBADF
 +-- FileSystemError
 +-- FileExistsError EEXIST
 +-- FileNotFoundError ENOENT
-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /