Message169153
Since WindowsError became an alias of OSError, the error number shown in the stringification of an OSError err can either be a windows error code (err.winerror) or a posix style error number (err.errno), with no way to tell which.
For instance in
>>> os.read(999, 0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 9] Bad file descriptor
err.errno == EBADF == 9 and err.winerror == None, but in
>>> _winapi.ReadFile(999, 0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Error 6] The handle is invalid
err.errno == EBADF == 9 and err.winerror == ERROR_INVALID_HANDLE == 6. (winerror gets priority over errno if it exists.)
With the attached patch the second will be shown as
>>> _winapi.ReadFile(999, 0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [WinError 6] The handle is invalid
^^^
Since this issue only applies to 3.3 and the patch is trivial, it would be nice to get this in before 3.3 is released. |
|
Date |
User |
Action |
Args |
2012-08-25 18:44:37 | sbt | set | recipients:
+ sbt, pitrou |
2012-08-25 18:44:37 | sbt | set | messageid: <1345920277.5.0.279969365859.issue15784@psf.upfronthosting.co.za> |
2012-08-25 18:44:36 | sbt | link | issue15784 messages |
2012-08-25 18:44:36 | sbt | create | |
|