[Zope-dev] Bug in 2.1.2?

Andrew M. Kuchling akuchlin@mems-exchange.org
Wed, 12 Jan 2000 10:38:31 -0500 (EST)


Robert Sander writes:
>Hi!
>In file .../zope/lib/python/ZPublish/Publish.py line 173:
>	except KeyError:
>should say
>	except TypeError, KeyError:

Is that the right file?  In my copy of Zope 2.1.2, the only except:
near line 173 of Publish.py is just 'except:', and KeyError doesn't
appear in the file at all.  And what bug or problem is this supposed
to fix?  (People will rarely incorporate patches when there's no
indication of the purpose of the patch; Digicool is probably no
exception.)

Incidentally, the code you quote should read "except (TypeError,
KeyError):" ; otherwise, it'll catch TypeError, and bind the exception
to the name 'KeyError', which is not what's wanted!  (One of Python's
gotchas...)

-- 
A.M. Kuchling			http://starship.python.net/crew/amk/
I have found some of the best reasons I ever had for remaining at the bottom
simply by looking at the men at the top.
    -- Frank Moore Colby