[techtalk] python problem

Malcolm Tredinnick malcolmt at smart.net.au
Thu Dec 23 12:07:46 EST 1999


On Wed, Dec 22, 1999 at 10:43:45AM +1100, Malcolm Tredinnick wrote:
[... problem description snipped for space reasons ...]
> The problem does indeed exist (which I was not willing to believe initially,
> since it just seemed so silly), but it is not Python's fault! It is a problem
> in the Linux C library (assuming the man pages can be trusted). The two
> functions strftime() and strptime() are implemented in terms of the C
> functions of the corresponding names. Looking at 'man strftime', we see that
> it takes a %Z modifier, whereas 'man strptime' takes no such modifier!
> 
> So that explains the mystery -- albeit fairly unsatisfactorily. I've taken the
> liberty of posting some information about this to the Python mailing list
> (which is also the newsgroup comp.lang.python) to see what the story is on
> other Unices.

Probably nobody except Fred cares about this, but just in case: here are the
results of some discussion on the Python mailing list about this problem:

Result #1: Malcolm is an idiot!! I made so many typos in the code sample I
posted that *everybody* was getting errors - unfortunately, none of the errors
had any bearing on the problem at hand. We got that sorted out in the end. Of
course, I'll have to wear a paper bag over my head and use an
email-anonymizer when posting to that list in the future, but life goes on :-)

Result #2:  It is a purely Linux problem. Somebody, somewhere made a booboo in
the libc libraries and it hasn't been fixed. There is no real reason why it
can't be fixed at some stage, since adding an extra modifier won't break
existing code, but that's the current state of play.

Result #3: (I should have mentioned this originally) If you are doing a
lot of work with dates and times in Python, it is worth looking at Marc-Andre
Lemburg's mxDateTime module (starship.skyport.net/~lemburg/). It doesn't help
with the exact problem we are discussing here, but it's useful to know about.

Cheers,
Malcolm Tredinnick

--
Nothing is fool-proof to a talented fool.


************
techtalk at linuxchix.org   http://www.linuxchix.org




More information about the Techtalk mailing list