I spoke too soon. UnicodeEncodeError is a subclass of ValueError. So
catching ValueError from int(str_or_unicode) is the way to go. Who's
writing that Zope 3 style guide again?
Great.
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ZopePythonStyleGuide
--
Steve Alexander
_
Anything can raise MemoryError.
Ok. But I don't think regular application code should catch these.
On converting an 8bit string to an int:
ValueError *only*
Ok.
On converting a Unicode string to an int:
ValueError
UnicodeError (or UnicodeEncodeError, which is a subclass
Guido van Rossum wrote:
Can we get the same patch without the generic "except:", please?
int() happens to raise a bunch of different exceptions, and I think
an unqualified except: clause is okay here (though it needs a
comment).
I think this would be a useful note for the Zope3 style guide.
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 box...
Why would this particular except clause cause database corruptio
Casey Duncan wrote:
Please submit a collector issue for this http://collector.zope.org/Zope so the
patch doesn't get lost.
I tried it first, but my zope member login hadn't work yet and I had a
problem with file uploading. I'm new with the collector, was I doing
some things wrong?
--
Dmitry