[Python-Dev] [Python-checkins] r45925 - in python/trunk: Lib/tempfile.py Lib/test/test_os.py Misc/NEWS Modules/posixmodule.c
"Martin v. Löwis"
martin at v.loewis.de
Wed May 10 21:24:53 CEST 2006
M.-A. Lemburg wrote:
> I've tried to find documentation on _dosmaperr() but there's
> nothing on MSDN. Is this an official API ?
No. It always was undocumented, and apparently intentionally so
(both the API, and the precise details of the mapping).
> FWIW, this is the official system error code table:
This is actually the contents of winerror.h (in a different presentation
> A complete table would be quite large...
Actually, no. _dosmaperr maps the majority of the codes to EINVAL
(invalid argument). Only a small subset is special-cased.
> Right, but the APIs you changed used to raise IOError
> using the DOS error codes - this is where there's an
> incompatibility, since they now raise WindowsErrors
> with completely different error codes.
> The discussion
> suggests that you are aware of this.
I fully understand that this is an incompatible change; sure.
I'm saying that changing WindowsError to include set errno
to DOS error codes would *also* be an incompatible change.
> Since code catching IOError will also see any WindowsError
> exception, I'd opt for making .errno always return the
> DOS/BSD error codes and have WindowsError grow an
> additional .winerrno attribute which contains the
> more fine-grained Win32 error code.
Ok. I'll try to come up with a patch, but let me repeat
this: even though this would nearly restore the behavior
for the functions that I changed, it would *a different*
incompatible change, since it would change the behavior
of the places that *currently* (i.e. in 2.4)
More information about the Python-Dev