[issue1386675] _winreg specifies EnvironmentError instead of WindowsError
Mark Hammond
report at bugs.python.org
Sat Mar 21 01:24:55 CET 2009
Mark Hammond <mhammond at users.sourceforge.net> added the comment:
oops - this slipped off my radar. I agree with *both* Frederic and Tony
:) The module promises to raise an EnvironmentError, which is does.
However, the main killer from my POV is that a 'winerror' attribute is
likely to be of interest, and this is only available if we promise a
WindowsError. In other words, to write code which conformed to the
docs, you would need to write:
try:
...
except WindowsError, exc:
if exc.winerror==SOME_INTERESTING_CODE:...
except EnvironmentError, exc:
# hrmph..
The second except clause is not actually necessary based on the impl,
but is according to the docs. For this reason I'd be happy to update
the docs to reflect the implementation reality.
----------
assignee: mhammond -> fdrake
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1386675>
_______________________________________
More information about the Python-bugs-list
mailing list