Add items to survey.
This commit is contained in:
parent
f2d48d150d
commit
81cd118c17
55
pep-3151.txt
55
pep-3151.txt
|
@ -49,6 +49,7 @@ of classes, arranged in the following subhierarchies::
|
|||
+-- socket.error
|
||||
+-- OSError
|
||||
+-- WindowsError
|
||||
+-- mmap.error
|
||||
+-- select.error
|
||||
|
||||
While some of these distinctions can be explained by implementation
|
||||
|
@ -199,6 +200,7 @@ The extent of this step is not yet fully determined. A number of possible
|
|||
changes are listed hereafter:
|
||||
|
||||
* alias both socket.error and select.error to IOError
|
||||
* alias mmap.error to OSError
|
||||
* alias IOError to OSError
|
||||
* alias WindowsError to OSError
|
||||
|
||||
|
@ -517,6 +519,9 @@ Handling of PYTHONSTARTUP raises IOError (but the error gets discarded)::
|
|||
`FILE *` parameter (which, in the source tree, is always either stdout or
|
||||
stderr).
|
||||
|
||||
Unicode encoding and decoding using the ``mbcs`` encoding can raise
|
||||
WindowsError for some error conditions.
|
||||
|
||||
Standard library
|
||||
----------------
|
||||
|
||||
|
@ -616,16 +621,54 @@ Raises IOError when the underlying OS resource becomes invalid::
|
|||
File "<stdin>", line 1, in <module>
|
||||
IOError: telling position disabled by next() call
|
||||
|
||||
Raises BlockingIOError (inherited from IOError) when a call on a non-blocking
|
||||
Raises BlockingIOError (inheriting from IOError) when a call on a non-blocking
|
||||
object would block.
|
||||
|
||||
mmap
|
||||
''''
|
||||
|
||||
Undex Unix, raises its own ``mmap.error`` (inheriting from EnvironmentError)
|
||||
throughout::
|
||||
|
||||
>>> mmap.mmap(123, 10)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in <module>
|
||||
mmap.error: [Errno 9] Bad file descriptor
|
||||
>>> mmap.mmap(os.open("/tmp", os.O_RDONLY), 10)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in <module>
|
||||
mmap.error: [Errno 13] Permission denied
|
||||
|
||||
Under Windows, however, it mostly raises WindowsError (the source code
|
||||
also shows a few occurrences of ``mmap.error``)::
|
||||
|
||||
>>> fd = os.open("LICENSE", os.O_RDONLY)
|
||||
>>> m = mmap.mmap(fd, 16384)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in <module>
|
||||
WindowsError: [Error 5] Accès refusé
|
||||
>>> sys.last_value.errno
|
||||
13
|
||||
>>> errno.errorcode[13]
|
||||
'EACCES'
|
||||
|
||||
>>> m = mmap.mmap(-1, 4096)
|
||||
>>> m.resize(16384)
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in <module>
|
||||
WindowsError: [Error 87] Paramètre incorrect
|
||||
>>> sys.last_value.errno
|
||||
22
|
||||
>>> errno.errorcode[22]
|
||||
'EINVAL'
|
||||
|
||||
multiprocessing
|
||||
'''''''''''''''
|
||||
|
||||
Not examined.
|
||||
|
||||
os / posix module
|
||||
'''''''''''''''''
|
||||
os / posix
|
||||
''''''''''
|
||||
|
||||
The ``os`` (or ``posix``) module raises OSError throughout, except under
|
||||
Windows where WindosError can be raised instead.
|
||||
|
@ -676,6 +719,12 @@ socket
|
|||
|
||||
socket.error inherits from IOError.
|
||||
|
||||
sys
|
||||
'''
|
||||
|
||||
``sys.getwindowsversion()`` raises WindowsError with a bogus error number
|
||||
if the ``GetVersionEx()`` call fails.
|
||||
|
||||
time
|
||||
''''
|
||||
|
||||
|
|
Loading…
Reference in New Issue