[Zope-dev] Greedy except clauses

Anthony Baxter Anthony Baxter <anthony@interlink.com.au>
Fri, 09 Feb 2001 17:43:30 +0000


ooo. Richard didn't do it right - there's actually over _600_ bareword
except: clauses in the current zope-2_3-branch

A quick breakdown of some of the biggies:

71 in OFS/
61 in ZODB/
56 in ZServer/
53 in ZGadflyDA
50 or so in what seems to be test scripts or modules (probably ok)
42 in ZPublisher/
42 in DocumentTemplate/
40 in App/
38 in AccessControl/
32 in Shared/DC/ZRDB/
24 in ZCatalog
15 in webdav/
15 in DateTime/
13 in PythonScripts
12 in utilities/ or the install scripts
11 in OFSP/

Now, it's obvious that not all of these are bad - some are probably fine -
but there's also many that are _not_ good. The one in MailHost.py does
eat exceptions. I'm sure there are others.

I've done a quickie hack script that runs over the source and produces 
a list of matches to lines in the file, and links to a lightly patched
viewcvs so that you can jump straight to the lines. It seems like it
would be reasonably easy to make this a bit more sophisticated to include
things like the nesting 'def' and 'class' method. 

This, to me, seems like a pretty nice community type task - people could
take one of them off the list of unchecked ones, and have a look through
the code... no?

Anthony