Re: [Zope-dev] BUG: ValueError while changing height of the templateedit window

2002-12-11 Thread Dmitry Vasiliev
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

Re: [Zope-dev] BUG: ValueError while changing height of the templateedit window

2002-12-11 Thread Steve Alexander
Guido van Rossum wrote: Can we get the same patch without the generic except:, please? snipped part about whether there could be database corruption 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

Re: [Zope-dev] BUG: ValueError while changing height of the templateedit window

2002-12-11 Thread 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

Re: [Zope-dev] BUG: ValueError while changing height of the templateedit window

2002-12-11 Thread Steve Alexander
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

Re: [Zope-dev] BUG: ValueError while changing height of the templateedit window

2002-12-10 Thread Dmitry Vasiliev
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