diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-08 12:00:02 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-08 12:00:02 (GMT) |
commit | 94ad49fabc15c2eaafb5b590701ceb642d56bec0 (patch) | |
tree | aea81c8169370c8ace0c02a38511da35f6ba369b /Lib/plistlib.py | |
parent | 152a19c6bd59b772660c8af050248a196bb6a848 (diff) | |
download | cpython-94ad49fabc15c2eaafb5b590701ceb642d56bec0.zip cpython-94ad49fabc15c2eaafb5b590701ceb642d56bec0.tar.gz cpython-94ad49fabc15c2eaafb5b590701ceb642d56bec0.tar.bz2 |
Issue #26709: Fixed Y2038 problem in loading binary PLists.
Diffstat (limited to 'Lib/plistlib.py')
-rw-r--r-- | Lib/plistlib.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/plistlib.py b/Lib/plistlib.py index b9946fd..a39151f 100644 --- a/Lib/plistlib.py +++ b/Lib/plistlib.py @@ -685,7 +685,7 @@ class _BinaryPlistParser: f = struct.unpack('>d', self._fp.read(8))[0] # timestamp 0 of binary plists corresponds to 1/1/2001 # (year of Mac OS X 10.0), instead of 1/1/1970. - return datetime.datetime.utcfromtimestamp(f + (31 * 365 + 8) * 86400) + return datetime.datetime(2001, 1, 1) + datetime.timedelta(seconds=f) elif tokenH == 0x40: # data s = self._get_size(tokenL) |