[Python-checkins] r83024 - sandbox/trunk/errnopep/pepXXXX.txt
antoine.pitrou
python-checkins at python.org
Wed Jul 21 17:36:19 CEST 2010
Author: antoine.pitrou
Date: Wed Jul 21 17:36:19 2010
New Revision: 83024
Log:
Some cosmetic fixes
Modified:
sandbox/trunk/errnopep/pepXXXX.txt
Modified: sandbox/trunk/errnopep/pepXXXX.txt
==============================================================================
--- sandbox/trunk/errnopep/pepXXXX.txt (original)
+++ sandbox/trunk/errnopep/pepXXXX.txt Wed Jul 21 17:36:19 2010
@@ -1,13 +1,15 @@
-PEP: 3789
+PEP: 3151
Title: Reworking the OS and IO exception hierarchy
Version: $Revision: $
Last-Modified: $Date: $
Author: Antoine Pitrou <solipsis at pitrou.net>
-Status:
+Status: Draft
Type: Standards Track
Content-Type: text/x-rst
-Created:
+Created: 2010-07-21
+Python-Version: 3.2 or 3.3
Post-History:
+Resolution: TBD
Abstract
@@ -217,36 +219,36 @@
The following temptative list of subclasses, along with a description and
the list of errnos mapped to them, is submitted to discussion:
-* FileAlreadyExists: trying to create a file or directory which already
+* ``FileAlreadyExists``: trying to create a file or directory which already
exists (EEXIST)
-* FileNotFound: for all circumstances where a file and directory is
+* ``FileNotFound``: for all circumstances where a file and directory is
requested but doesn't exist (ENOENT)
-* IsADirectory: file-level operation (open(), os.remove()...) requested
+* ``IsADirectory``: file-level operation (open(), os.remove()...) requested
on a directory (EISDIR)
-* NotADirectory: directory-level operation requested on something else
+* ``NotADirectory``: directory-level operation requested on something else
(ENOTDIR)
-* PermissionDenied: trying to run an operation without the adequate access
+* ``PermissionDenied``: trying to run an operation without the adequate access
rights - for example filesystem permissions (EACCESS, optionally EPERM)
-* BlockingIOError: an operation would block on an object (e.g. socket) set
+* ``BlockingIOError``: an operation would block on an object (e.g. socket) set
for non-blocking operation (EAGAIN, EALREADY, EWOULDBLOCK, EINPROGRESS);
this is the existing ``io.BlockingIOError`` with an extended role
-* BadFileDescriptor: operation on an invalid file descriptor (EBADF);
+* ``BadFileDescriptor``: 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
-* ConnectionAborted: connection attempt aborted by peer (ECONNABORTED)
+* ``ConnectionAborted``: connection attempt aborted by peer (ECONNABORTED)
-* ConnectionRefused: connection reset by peer (ECONNREFUSED)
+* ``ConnectionRefused``: connection reset by peer (ECONNREFUSED)
-* ConnectionReset: connection reset by peer (ECONNRESET)
+* ``ConnectionReset``: connection reset by peer (ECONNRESET)
-* TimeoutError: connection timed out (ECONNTIMEOUT); this could be re-cast
+* ``TimeoutError``: connection timed out (ECONNTIMEOUT); this could be re-cast
as a generic timeout exception, useful for other types of timeout (for
example in Lock.acquire())
@@ -418,7 +420,7 @@
--------------------------
* ``EBADF``: bad file descriptor (usually means the file descriptor was
- closed)
+ closed)
* ``EEXIST``: file or directory exists
@@ -460,9 +462,10 @@
when calling read() on a socket's file descriptor.
* ``EAGAIN``: resource temporarily unavailable (during a non-blocking socket
- call except connect())
+ call except connect())
-* ``EALREADY``: connection already in progress (during a non-blocking connect())
+* ``EALREADY``: connection already in progress (during a non-blocking
+ connect())
* ``EINPROGRESS``: operation in progress (during a non-blocking connect())
@@ -488,7 +491,6 @@
* ``EINTR``: interrupted function call
-
Appendix B: Survey of raised OS and IO errors
=============================================
@@ -508,12 +510,11 @@
`FILE *` parameter (which, in the source tree, is always either stdout or
stderr).
-
-Modules
--------
+Standard library
+----------------
bz2
-~~~
+'''
Raises IOError throughout (OSError is unused)::
@@ -531,12 +532,12 @@
IOError: file is not ready for reading
curses
-~~~~~~
+''''''
Not examined.
dbm.gnu, dbm.ndbm
-~~~~~~~~~~~~~~~~~
+'''''''''''''''''
_dbm.error and _gdbm.error inherit from IOError::
@@ -546,12 +547,12 @@
_gdbm.error: [Errno 2] No such file or directory
fcntl
-~~~~~
+'''''
Raises IOError throughout (OSError is unused).
imp module
-~~~~~~~~~~
+''''''''''
Raises IOError for bad file descriptors::
@@ -561,7 +562,7 @@
IOError: [Errno 9] Bad file descriptor
io module
-~~~~~~~~~
+'''''''''
Raises IOError when trying to open a directory under Unix::
@@ -613,12 +614,12 @@
object would block.
multiprocessing
-~~~~~~~~~~~~~~~
+'''''''''''''''
Not examined.
ossaudiodev
-~~~~~~~~~~~
+'''''''''''
Raises IOError throughout (OSError is unused)::
@@ -628,7 +629,7 @@
IOError: [Errno 2] No such file or directory: 'foo'
readline
-~~~~~~~~
+''''''''
Raises IOError in various file-handling functions::
@@ -646,7 +647,7 @@
IOError: [Errno 13] Permission denied
select
-~~~~~~
+''''''
select() and poll objects raise select.error, which doesn't inherit from
anything (but poll.modify() which raises IOError).
@@ -654,22 +655,22 @@
kqueue objects raise both OSError and IOError.
signal
-~~~~~~
+''''''
signal.ItimerError inherits from IOError.
socket
-~~~~~~
+''''''
socket.error inherits from IOError.
time
-~~~~
+''''
Raises IOError for internal errors in time.time() and time.sleep().
zipimport
-~~~~~~~~~
+'''''''''
zipimporter.get_data() can raise IOError.
@@ -688,3 +689,13 @@
This document has been placed in the public domain.
+
+
+..
+ Local Variables:
+ mode: indented-text
+ indent-tabs-mode: nil
+ sentence-end-double-space: t
+ fill-column: 70
+ coding: utf-8
+ End:
More information about the Python-checkins
mailing list