# HG changeset patch # Parent 858cb1538531ab169a27a6821c9f84bfa5451912 Issue #20220: Add DST rules to work around glibc quirk Also revert debugging added for duplicate Issue #25168. diff -r 858cb1538531 Lib/test/datetimetester.py --- a/Lib/test/datetimetester.py Sat Nov 14 15:14:58 2015 -0800 +++ b/Lib/test/datetimetester.py Sat Nov 14 20:20:56 2015 -0500 @@ -1979,16 +1979,7 @@ seconds = tzseconds hours, minutes = divmod(seconds//60, 60) dtstr = "{}{:02d}{:02d} {}".format(sign, hours, minutes, tzname) - try: - dt = strptime(dtstr, "%z %Z") - except ValueError: - import os - self.fail( - "Issue #25168 strptime() failure info:\n" - f"_TimeRE_cache['Z']={_strptime._TimeRE_cache['Z']!r}\n" - f"TZ={os.environ.get('TZ')!r}, or {os.getenv('TZ')!r} via getenv()\n" - f"_regex_cache={_strptime._regex_cache!r}\n" - ) + dt = strptime(dtstr, "%z %Z") self.assertEqual(dt.utcoffset(), timedelta(seconds=tzseconds)) self.assertEqual(dt.tzname(), tzname) # Can produce inconsistent datetime diff -r 858cb1538531 Lib/test/test_imaplib.py --- a/Lib/test/test_imaplib.py Sat Nov 14 15:14:58 2015 -0800 +++ b/Lib/test/test_imaplib.py Sat Nov 14 20:20:56 2015 -0500 @@ -54,7 +54,9 @@ '"18-May-2033 05:33:20 +0200"'] @run_with_locale('LC_ALL', 'de_DE', 'fr_FR') - @run_with_tz('STD-1DST') + # DST rules included to work around quirk where the Gnu C library may not + # otherwise restore the previous time zone + @run_with_tz('STD-1DST,M3.2.0,M11.1.0') def test_Time2Internaldate(self): expected = '"18-May-2033 05:33:20 +0200"'