[Zope-dev] Greedy except clauses

richard@bizarsoftware.com.au richard@bizarsoftware.com.au
Fri, 09 Feb 2001 14:05:56 +1100


I've run into several greedy except: clauses now, and have submitted
patches to make them a little less greedy. Out of curiosity, I searched the
Zope source for "unfiltered" except: clauses...

% grep -rl "except:$" . |wc -l
102

... erk

Just picking some of the results of that search at random, I noticed places
where underlying exceptions could be eaten where I'm sure they'd be better
propogated up...

BTW, I did that little search above when I had a stupid (read: cut'n'paste
:) bit of code that recursed on itself. Python generates a RuntimeError
when that happens. I didn't get the RuntimeError. Zope simply quit on me
with no error message. I have no idea where the RuntimeError is being
caught, but I would strongly argue that it shouldn't be!

I'm willing to have a go at cleaning some of those except: clauses up, but
I can't possibly do 102 of them (I have a product dealine coming up :)


    Richard

-- 
Richard Jones
richard@bizarsoftware.com.au
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)