Mapping EBADF is not very useful (as pointed out by Nick)
This commit is contained in:
parent
84dda3bb67
commit
089008558c
11
pep-3151.txt
11
pep-3151.txt
|
@ -335,14 +335,14 @@ Prerequisite
|
|||
`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 @@ the list of errnos mapped to them, is submitted to discussion:
|
|||
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 @@ shown::
|
|||
+-- ConnectionAbortedError ECONNABORTED
|
||||
+-- ConnectionRefusedError ECONNREFUSED
|
||||
+-- ConnectionResetError ECONNRESET
|
||||
+-- FileDescriptorError EBADF
|
||||
+-- FileSystemError
|
||||
+-- FileExistsError EEXIST
|
||||
+-- FileNotFoundError ENOENT
|
||||
|
|
Loading…
Reference in New Issue