[Python-Dev] Breaking bug #411881 into manageable pieces (original) (raw)

Guido van Rossum guido@python.org
Tue, 19 Mar 2002 19:13:15 -0500


About a year ago, Itamar Shtull-Trauring filed a bug report about the use of unqualified except clauses in the standard library. Over the past year a number of instances have been corrected, but many remain. I made a pass through those that remain and tried to break them into four groups:

* Obviously okay, because the code must potentially recover from just about anything. Modules like repr.py fall into this category. * Not worth fixing, because the except: occurs in situations that would not affect application code (such as in module tests). * Instances that should probably be fixed because it appears only a narrow set of exceptions could be raised by the code called from their try: blocks. * I Trust Tim (tm). I'd like to break this bug into multiple pieces by * open a separate bug for each module that uses unqualified except clauses that don't obviously need to guard against random exceptions (see my notes below).

Hm, I think it may take more time to create all those bug reports than it would to fix half of them. So fix half of them first, thereby greatly reducing the rest.

* for those uses that are obviously okay or don't seem worth fixing, add a short comment to the code explaining why it's okay in the neighborhood of the use.

+1

* close bug #411881 with a reference to the new bugs spawned by this exercise.

I think I'd be happy to keep this bug open as the "master bug" for all modules.

While this will increase the number of open bugs, it will make this issue more tractable. As currently constituted, I don't see this bug report ever getting closed.

This one and so many others...

Attached are the notes I took while picking through the source.

Which BTW can be decoded easily by using

python Lib/base64.py -d

--Guido van Rossum (home page: http://www.python.org/~guido/)