Author martin.panter
Recipients David.Edelsohn, belopolsky, berker.peksag, lars.gustaebel, lemburg, martin.panter, pitrou, serhiy.storchaka, vstinner
Date 2015-11-15.00:56:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The problem is probably triggered by the test in test_imaplib which sets the timezone to “STD-1DST”. It was added in revision 42b9d9d795f7, in 2012 for Python 3.3 only, which explains why we don’t have any trouble with Python 2.

I am no expert on time zone settings, but this either looks like a bug or unfortunate quirk in the C library. I only have the Gnu library handy to play with at the moment. Using my demo C program, it looks like tzset() fails to update tzname if both (1) New York time is set rather than UTC and (2) the temporary TZ value did not include DST rules:

$ sudo timedatectl status  # Note UTC time zone
      Local time: Sun 2015-11-15 00:16:54 UTC
  Universal time: Sun 2015-11-15 00:16:54 UTC
        RTC time: Sun 2015-11-15 00:16:54
       Time zone: UTC (UTC, +0000)
 Network time on: no
NTP synchronized: no
 RTC in local TZ: no
$ sudo timedatectl set-timezone America/New_York
$ ./tz-quirk "STD-1DST"
Initially: TZ=<unset> tzname={"GMT", "GMT"}
After tzset(): TZ=<unset> tzname={"EST", "EDT"}
Set TZ: TZ="STD-1DST" tzname={"STD", "DST"}
Unset TZ: TZ=<unset> tzname={"STD", "DST"}

If you include DST rules in the TZ value, the problem does not occur. Maybe this could be a good enough workaround:

$ ./tz-quirk "STD-1DST,M3.2.0,M11.1.0"
Initially: TZ=<unset> tzname={"GMT", "GMT"}
After tzset(): TZ=<unset> tzname={"EST", "EDT"}
Set TZ: TZ="STD-1DST,M3.2.0,M11.1.0" tzname={"STD", "DST"}
Unset TZ: TZ=<unset> tzname={"EST", "EDT"}

$ sudo timedatectl set-timezone UTC  # Restore my setting
$ pacman -Qo /lib/
/usr/lib/ is owned by glibc 2.22-3
Date User Action Args
2015-11-15 00:56:52martin.pantersetrecipients: + martin.panter, lemburg, belopolsky, lars.gustaebel, pitrou, vstinner, berker.peksag, serhiy.storchaka, David.Edelsohn
2015-11-15 00:56:52martin.pantersetmessageid: <>
2015-11-15 00:56:52martin.panterlinkissue20220 messages
2015-11-15 00:56:51martin.pantercreate