Re: [Zope-dev] BUG: ValueError while changing height of the template edit window
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 can't encode character '\u1234' in position 0: invalid decimal Unicode string
In Python 2.2, this raises ValueError.
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? --Guido van Rossum (home page: http://www.python.org/~guido/)
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/ZopePythonS... -- Steve Alexander
participants (2)
-
Guido van Rossum -
Steve Alexander