On Wednesday 11 December 2002 03:43 am, Dmitry Vasiliev wrote:
Casey Duncan wrote:
On Tuesday 10 December 2002 03:14 pm, Guido van Rossum wrote:
Can we get the same patch without the generic except:, please?
the last thing I want is a database corruption caused by resizing the
Edit
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
I think this would be a useful note for the Zope3 style guide.
What exceptions can int() raise?
On converting a preexisting value to an int:
ValueError, OverflowError, TypeError, AttributeError
(Any others?)
On converting an instance that implements __int__:
Anything
Anything can raise MemoryError.
Ok. But I don't think regular application code should catch these.
Correct.
On converting an 8bit string to an int:
ValueError *only*
Ok.
On converting a Unicode string to an int:
ValueError
UnicodeError (or
Can you provide an example of raising a unicode error like this:
u = makeUnicodeString() # your choice of function
int(u)
In Python 2.3, I get this:
int(u\u1234)
Traceback (most recent call last):
File stdin, line 1, in ?
UnicodeEncodeError: 'decimal' codec
Hi All!
Zope 2.6: pressing of Taller or Shorter buttons of the page template
edit window raises ValueError. Patch attached.
--
Dmitry Vasiliev (dima at hlabs.spb.ru)
Index: ZopePageTemplate.py
===
RCS file:
Please submit a collector issue for this http://collector.zope.org/Zope so the
patch doesn't get lost.
Thanks.
-Casey
On Tuesday 10 December 2002 10:07 am, Dmitry Vasiliev wrote:
Hi All!
Zope 2.6: pressing of Taller or Shorter buttons of the page template
edit window raises ValueError.
Can we get the same patch without the generic except:, please?
the last thing I want is a database corruption caused by resizing the
Edit box...
Why would this particular except clause cause database corruption?
int() happens to raise a bunch of different exceptions, and I think
an
On Tuesday 10 December 2002 03:14 pm, Guido van Rossum wrote:
Can we get the same patch without the generic except:, please?
the last thing I want is a database corruption caused by resizing the
Edit box...
Why would this particular except clause cause database corruption?
I think