This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients Arfrever, belopolsky, flox, nadeem.vawda, pitrou, python-dev, rosslagerwall, vinay.sajip
Date 2011-11-10.23:38:13
SpamBayes Score 1.4254056e-06
Marked as misclassified No
Message-id <1320968294.41.0.481853718841.issue13309@psf.upfronthosting.co.za>
In-reply-to
Content
It is definitely a glibc issue. Here's a C snippet to reproduce:

"""
#include <time.h>
#include <stdlib.h>

int main() {
    time_t t;
    struct tm tmp;
    char str[200];

    t = time(NULL);
    tmp = *gmtime(&t);
    tmp.tm_gmtoff = 0;
    tmp.tm_zone = NULL;

    strftime(str, sizeof(str), "%Z", &tmp);
    puts(str);

    t = -2461446500;
    localtime(&t);

    t = time(NULL);
    tmp = *gmtime(&t);
    tmp.tm_gmtoff = 0;
    tmp.tm_zone = NULL;

    strftime(str, sizeof(str), "%Z", &tmp);
    puts(str);

    return 0;
}
"""

Output:
CET
PMT


Calling localtime() or mktime() with a time largely in the past seems to corrupt the glibc's internal time structures (the "char *tm_zone[]").
History
Date User Action Args
2011-11-10 23:38:14pitrousetrecipients: + pitrou, vinay.sajip, belopolsky, nadeem.vawda, Arfrever, flox, rosslagerwall, python-dev
2011-11-10 23:38:14pitrousetmessageid: <1320968294.41.0.481853718841.issue13309@psf.upfronthosting.co.za>
2011-11-10 23:38:13pitroulinkissue13309 messages
2011-11-10 23:38:13pitroucreate