[Zope-Coders] DateTime with negative dates (Collector #484)

Shane Hathaway shane@zope.com
Fri, 17 Jan 2003 10:01:29 -0500


Lennart Regebro wrote:
> If you create a DateTime object that is before 1970/01/01 00:00 on windows,
> you get an error message:
> 
>   File "DateTime.py", line 405, in safelocaltime
>     rval = localtime(t_int)
> IOError: [Errno 22] Invalid argument
> 
> This is because windows localtime() can't handle dates before 1970/01/01.
> There is a couple of ways of handling this:

IOError seems like the wrong kind of exception.  Maybe that's a bug--I 
would expect a ValueError.

Shane