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.
Created on 2016年04月07日 09:46 by serhiy.storchaka, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| plistlib_large_timestamp.patch | serhiy.storchaka, 2016年04月07日 09:46 | review | ||
| Messages (4) | |||
|---|---|---|---|
| msg262986 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年04月07日 09:46 | |
Plistlib fails to load dates before year 1901 and after year 2038 in binary format on platforms with 32-bit time_t. >>> data = plistlib.dumps(datetime.datetime(1901, 1, 1), fmt=plistlib.FMT_BINARY) >>> plistlib.loads(data) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/serhiy/py/cpython/Lib/plistlib.py", line 1006, in loads fp, fmt=fmt, use_builtin_types=use_builtin_types, dict_type=dict_type) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 997, in load return p.parse(fp) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 623, in parse return self._read_object(self._object_offsets[top_object]) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 688, in _read_object return datetime.datetime.utcfromtimestamp(f + (31 * 365 + 8) * 86400) OverflowError: timestamp out of range for platform time_t >>> data = plistlib.dumps(datetime.datetime(2039, 1, 1), fmt=plistlib.FMT_BINARY) >>> plistlib.loads(data) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/serhiy/py/cpython/Lib/plistlib.py", line 1006, in loads fp, fmt=fmt, use_builtin_types=use_builtin_types, dict_type=dict_type) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 997, in load return p.parse(fp) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 623, in parse return self._read_object(self._object_offsets[top_object]) File "/home/serhiy/py/cpython/Lib/plistlib.py", line 688, in _read_object return datetime.datetime.utcfromtimestamp(f + (31 * 365 + 8) * 86400) OverflowError: timestamp out of range for platform time_t Proposed patch fixes this issue. |
|||
| msg263017 - (view) | Author: Ronald Oussoren (ronaldoussoren) * (Python committer) | Date: 2016年04月08日 10:54 | |
Patch looks good to me. |
|||
| msg263022 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年04月08日 12:01 | |
New changeset ba35b0404163 by Serhiy Storchaka in branch '3.5': Issue #26709: Fixed Y2038 problem in loading binary PLists. https://hg.python.org/cpython/rev/ba35b0404163 New changeset 778ccbe3cf74 by Serhiy Storchaka in branch 'default': Issue #26709: Fixed Y2038 problem in loading binary PLists. https://hg.python.org/cpython/rev/778ccbe3cf74 |
|||
| msg263023 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年04月08日 12:06 | |
Thanks Ronald. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:29 | admin | set | github: 70896 |
| 2016年04月08日 12:06:41 | serhiy.storchaka | set | status: open -> closed messages: + msg263023 assignee: serhiy.storchaka resolution: fixed stage: patch review -> resolved |
| 2016年04月08日 12:01:05 | python-dev | set | nosy:
+ python-dev messages: + msg263022 |
| 2016年04月08日 10:54:26 | ronaldoussoren | set | messages: + msg263017 |
| 2016年04月07日 09:46:22 | serhiy.storchaka | create | |