[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 22:13:23 CEST 2006


M.-A. Lemburg wrote:
> BTW, and intended as offer for compromise, should we instead
> add the Win32 codes to the errno module (or a new winerrno
> module) ?! I can write a parser that takes winerror.h and
> generates the module code.

Instead won't help: the breakage will still occur. It would
be possible to put symbolic constants into the except clauses,
instead of using the numeric values, but you still have to
add all these "except WindowsError,e" clauses, even if
the constants were available.

However, in addition would be useful: people will want to
check for specific Win32 error codes, just because they are
more descriptive. I propose to call the module "winerror"
(in parallel to winerror.h, just as the errno module
parallels errno.h)

Adding them all to the errno would work for most cases,
except that you get conflicts for errno.errcode.

Regards,
Martin



More information about the Python-Dev mailing list