[Zope-dev] ZEO cache instrumentation -- any takers?

Casey Duncan casey@zope.com
Thu, 3 Oct 2002 23:13:48 -0400


As much as I try to avoid them (especially in Zope code), they are someti=
mes=20
necessary because you simply don't know what exceptions might be raised f=
rom=20
inside Python or the standard libs. Besides, even if you stamped it out=20
people will just use:

try:
    ...
except Exception:

Besides, sometimes you really do want to trap all exceptions, do somethin=
g and=20
then re-raise them again. IMO that's not bad form if its not habitual.

Even simple operations in Python itself can raise various exceptions. For=
=20
instance, a humble int(x) can raise TypeError or ValueError, and Guido kn=
ows=20
what else ;^). That leads to me being less confident in my exception hand=
ling=20
then I would like to be.

At any rate Chris McDonough and I recently had a conversation about ZPT=20
catching all exceptions and his sneeking suspicion that it was a bad thin=
g=20
with regard to read conflicts, but I think we concluded it wasn't as bad =
as=20
he thought it might be. Maybe we were wrong.

Since you have identified these places in the code, I think it would be=20
worthwhile to add the following above the bare excepts in question to see=
=20
what happens:

except ReadConflictError:
    raise

If nothing else, you could rule this out.

-Casey

On Thursday 03 October 2002 08:58 pm, Guido van Rossum wrote:
> > PS: Hey, Guido, any chance of deprecating exceptionless 'exception:'
> > clauses anytime soon? We got a bunch of those making our life harder
> > on Zope :-)
>=20
> No chance for backwards compatibility, but I try to stamp them out
> whenever I see them.  Submit a tracker issue about the ones that
> particularly bug you -- with patch if you've got a suggestion.
>=20
> We'll get there still.
>=20
> --Guido van Rossum (home page: http://www.python.org/~guido/)
>=20
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>=20