cpython: 56260d30985d (original) (raw)
Mercurial > cpython
changeset 77939:56260d30985d
Closes #14902: Fixed timezone conversion of a date/time in the past. Thanks to Yuriy Syrovetskiy for the report and Juancarlo Añez for the patch on which this fix is based. [#14902]
Vinay Sajip <vinay_sajip@yahoo.co.uk> | |
---|---|
date | Tue, 03 Jul 2012 21:36:36 +0100 |
parents | 1f06fe5cd4da |
children | 980de5b47d0d |
files | Lib/test/test_logging.py Misc/ACKS |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_logging.py 6 Misc/ACKS 2 |
line wrap: on
line diff
--- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -2899,8 +2899,10 @@ class FormatterTest(unittest.TestCase): def test_time(self): r = self.get_record()
dt = datetime.datetime(1993,4,21,8,3,0,0,utc)[](#l1.7)
r.created = time.mktime(dt.timetuple()) - time.timezone[](#l1.8)
dt = datetime.datetime(1993, 4, 21, 8, 3, 0, 0, utc)[](#l1.9)
# We use None to indicate we want the local timezone[](#l1.10)
# We're essentially converting a UTC time to local time[](#l1.11)
r.created = time.mktime(dt.astimezone(None).timetuple())[](#l1.12) r.msecs = 123[](#l1.13) f = logging.Formatter('%(asctime)s %(message)s')[](#l1.14) f.converter = time.gmtime[](#l1.15)
--- a/Misc/ACKS +++ b/Misc/ACKS @@ -33,6 +33,7 @@ John Anderson Erik Andersén Oliver Andrich Ross Andrus +Juancarlo Añez Jérémy Anger Jon Anglin Éric Araujo @@ -1167,3 +1168,4 @@ Uwe Zessin Kai Zhu Tarek Ziadé Peter Åstrand +