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

Chris McDonough chrism@zope.com
11 Feb 2003 10:03:54 -0500


I think the time would be better spent fixing ZODB to not allow a
transaction commit after a non-resolvable conflict error is raised. 
Then bare except clauses would still be bad style, but not quite as
dangerous.

It'd be nice to add a test to the ZODB test suite that exposes the bug
so we can prove it's really as dangerous as everybody assumes.

- C


On Tue, 2003-02-11 at 09:46, R. David Murray wrote:
> 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
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )