[Zope-dev] Re: Bare "except" dangerous to ZODB? was Re: Accept-Charset hearders causing 500 internal server error.[correct but not lenient]

R. David Murray rdmurray+dated+1045406766.561d78@bitdance.com
Tue, 11 Feb 2003 09:46:02 -0500


Paul Winkler <pw_lists@slinkp.com> wrote:
>$ cd /usr/src/Zope-2.6.1-src/lib/python/Products/
>$ find . -name "*py" -exec grep -H "except:" {} \; | wc -l
>    170
>
>well, this is all stuff that comes with Zope, hopefully
>they have been vetted... but then there's all these

'fraid not.  These days they tend to get fixed when someone touches
the nearby code for other reasons, but no one has yet mounted
a campaign to fix them all, despite this having been a known problem
for quite some time now.

And it's generally easier just to never use a bare except than it
is to prove to yourself that the bare except isn't going to have
unintended consequences.  There are exceptions where a bare
except is needed, of course.

--RDM