[Zope-dev] BUG: ValueError while changing height of the template edit window

Guido van Rossum guido@python.org
Wed, 11 Dec 2002 09:52:59 -0500


> I saw "try: int() except:" pattern in many places through all the Zope 
> code. I think catching ValueError only does the job, but then we should 
> replace it in all the places. :-)

Yes, catching ValueError is sufficient for string conversions to int.

I thought you could get an OverflowError, but that can only happen
when the input is a Python long or float -- int("999999999999999")
raises ValueError, as does int("xxx").

--Guido van Rossum (home page: http://www.python.org/~guido/)