[Python-bugs-list] Re: mktime fails on specific dates (PR#139)

taliesin@nvg.org taliesin@nvg.org
Fri, 3 Dec 1999 12:05:52 -0500 (EST)

* Guido van Rossum (bugs-py@python.org) [991203 16:38]:
> > I was comparing dates the other day...
> > 
/snippage most what I said/
> > Possible fixes: 
> > - time-module sets TZ to UCT before calling mktime
> > - never use localtime on a machine :)
> > 
> > Please look into it or mention it clearly in the docs :)
> Not sure what you want us to do.  That local time doesn't exist,
> so an error is appropriate.  The OverflowError is documented in
> http://www.python.org/doc/current/lib/module-time.html.

You don't think it's a silly, unnecessary gotcha? It would be very nice
to *not* have to write umpteen different versions of a teeny function in
a teeny proggie to have it work on more than one platform, not to
mention the necessary "figure-out-what-os-we're-on-today"-logic. Not 
having to check the source-code for your os to figure out why something dies
would be nice too :) Side-effect of wrapping the c-functions I guess.

Calling timegm() instead of mktime() in time_mktime() in the time-module
prevents it on FreeBSD at least, as timegm() doesn't care about
timezones and dst at all...