[ python-Bugs-1386675 ] _winreg specifies EnvironmentError instead of WindowsError

SourceForge.net noreply at sourceforge.net
Thu Apr 27 01:19:36 CEST 2006


Bugs item #1386675, was opened at 2005-12-20 20:41
Message generated for change (Comment added) made by fdrake
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1386675&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Tony Meyer (anadelonbrin)
>Assigned to: Mark Hammond (mhammond)
Summary: _winreg specifies EnvironmentError instead of WindowsError

Initial Comment:
The _winreg documentation says that EnvironmentError
will be raised (throughout the docs, for various
reasons), when, in every case, WindowsError is actually
raised.

A simple replace of WindowsError for EnvironmentError
would fix this.  (Let me know if you really need a patch).

----------------------------------------------------------------------

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2006-04-26 19:19

Message:
Logged In: YES 
user_id=3066

Assigning to Mark Hammond since he should be able to tell us
what the docs *should* say, and why.

----------------------------------------------------------------------

Comment By: Georg Brandl (birkenfeld)
Date: 2005-12-27 12:26

Message:
Logged In: YES 
user_id=1188172

You're right. I reverted the checkin, assigning to Fred.

----------------------------------------------------------------------

Comment By: Fredrik Lundh (effbot)
Date: 2005-12-27 03:08

Message:
Logged In: YES 
user_id=38376

The original checkin used EnvironmentError in both
the documentation and the docstrings, so this is not
a result of some accidental editing.  Since a good
documentation policy for a portable language is to
document intended usage, not implementation artifacts,
you should at least check with the original authors
before you make the documentation depend on the current
CPython implementation.

(and no, using EnvironmentError is an entirely different
thing than using Exception.  Can we keep the hyperbolic
arguments on comp.lang.python, please?)

----------------------------------------------------------------------

Comment By: Georg Brandl (birkenfeld)
Date: 2005-12-26 19:03

Message:
Logged In: YES 
user_id=1188172

Corrected in rev. 41829/41830.

----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2005-12-25 21:36

Message:
Logged In: YES 
user_id=552329

I don't see what purpose there is in having the
documentation say that EnvironmentError is raised, when a
subclass is.  _winreg is still marked as a temporary module
to be replaced, so it's hard to believe it's some sort of
future-proofing.

One could say that Exception is raised, since
EnvironmentError is a subclass of Exception, but explicit is
better than implicit, right?

(import _winreg fails on non-Windows platforms, so I don't
see how it could be for cross-platform reasons, either).

----------------------------------------------------------------------

Comment By: Fredrik Lundh (effbot)
Date: 2005-12-25 06:44

Message:
Logged In: YES 
user_id=38376

however, note that

>>> issubclass(WindowsError, EnvironmentError)
True

on windows, and

>>> issubclass(WindowsError, EnvironmentError)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'WindowsError' is not defined

on non-windows platforms, so it might be done this way
on purpose.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1386675&group_id=5470


More information about the Python-bugs-list mailing list