Message262986
| Author |
serhiy.storchaka |
| Recipients |
belopolsky, ronaldoussoren, serhiy.storchaka |
| Date |
2016年04月07日.09:46:21 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1460022382.4.0.161874143104.issue26709@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年04月07日 09:46:22 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ronaldoussoren, belopolsky |
| 2016年04月07日 09:46:22 | serhiy.storchaka | set | messageid: <1460022382.4.0.161874143104.issue26709@psf.upfronthosting.co.za> |
| 2016年04月07日 09:46:22 | serhiy.storchaka | link | issue26709 messages |
| 2016年04月07日 09:46:21 | serhiy.storchaka | create |
|