Re: [Zope-dev] DateTime: ISO date range limited

2001-10-29 Thread Jens Quade

"Andreas Jung" <[EMAIL PROTECTED]> writes:

> This is a limitation of time.mktime() in Python but not of Zope.
> The ValueError seems not to be documented in the Python docs.

Yes, but it's the only call to 'mktime' in 'DateTime.py' and it seems that
calling it is unnecessary.

jens




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] DateTime: ISO date range limited

2001-10-29 Thread Jens Quade

Hi,

I'd expect the following shouldn't raise an exception:

[current Zope CVS]

>>> x=DateTime(1000,1,1)
>>> y=DateTime(x.HTML4())
Traceback (most recent call last):
  File "", line 1, in ?
  File "/home/jens/work/NGServer/dcCVS/Zope/lib/python/DateTime/DateTime.py", line 
716, in __init__
yr,mo,dy,hr,mn,sc,tz=self._parse_iso8601(arg)
  File "/home/jens/work/NGServer/dcCVS/Zope/lib/python/DateTime/DateTime.py", line 
1624, in _parse_iso8601
return self.__parse_iso8601(s)
  File "/home/jens/work/NGServer/dcCVS/Zope/lib/python/DateTime/DateTime.py", line 
1661, in __parse_iso8601
ts = mktime((year,month,day,hour,minute,seconds,0,0,0))
ValueError: year out of range
>>> 

The variable 'ts' calculated using 'mktime' is *not* used in the
result of '__parse_iso8601', so I wonder why the call exists.

jens



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )