[ZCM] [ZC] 1712/ 5 Comment "Inconsistent and sometimes incomprehensible error messages from bad dates"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Thu Apr 7 09:44:22 EDT 2005


Issue #1712 Update (Comment) "Inconsistent and sometimes incomprehensible error messages from bad dates"
 Status Wontfix, Zope/bug medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/1712

==============================================================
= Comment - Entry #5 by chrisw on Apr 7, 2005 9:44 am

I'm in complete agreement with Jamie here...
________________________________________
= Comment - Entry #4 by rjmunro on Apr 6, 2005 8:16 am

> changing the code again might raise 3rd-party compatibility
> issue relying on a certain exception.

I don't buy that argument. Current code that is relying on only a certain exception is already broken, because at any time it could get one of the other exceptions. Current code that catches all 4 exceptions won't care that only one of them ever happens in practice.
________________________________________
= Wontfix - Entry #3 by ajung on Apr 5, 2005 9:11 am

 Status: Pending => Wontfix

The DateTime parser is supposed to raise DateError, TimeError, DateTimeError *and* SyntaxError as exception. So this SyntaxError
looks perfectly fine. I agree that four different exceptions are
somewhat insane and should be replaced with a unique DateError
exception but changing the code again might raise 3rd-party compatibility issue relying on a certain exception. So marking the issue as Won't_fix.
________________________________________
= Comment - Entry #2 by rjmunro on Feb 25, 2005 9:40 am

I got the version wrong, I was actually using version 2.7.1. Things are improved in 2.7.4, but it can give "SyntaxError" instead of "DateError" under some circumstances.
________________________________________
= Request - Entry #1 by rjmunro on Feb 25, 2005 8:54 am

x = DateTime("99/99/99")
gives the excepton:
"DateError: 99/99/99"
which makes perfect sense, but:
x = DateTime("null/null/null")
gives the exception:
"AttributeError: SyntaxError instance has no attribute 'replace'"
and
x = DateTime("null")
gives the exception:
"IndexError: string index out of range"
neither of which make any sense.
==============================================================



More information about the Zope-Collector-Monitor mailing list