Message232112
| Author |
serhiy.storchaka |
| Recipients |
Connor.Wolf, belopolsky, ned.deily, ronaldoussoren, serhiy.storchaka |
| Date |
2014年12月04日.08:43:40 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1417682620.45.0.127707715277.issue22993@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Another limitation is that on 32-bit platform it is impossible to load date before datetime.datetime(1901, 12, 13, 20, 45, 52) from binary plist.
>>> plistlib.loads(b'bplist003'+struct.pack('>d', -2**31 - (31 * 365 + 8) * 86400)+b'\x08\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11')
datetime.datetime(1901, 12, 13, 20, 45, 52)
>>> plistlib.loads(b'bplist003'+struct.pack('>d', -2**31 - (31 * 365 + 8) * 86400 - 1)+b'\x08\x00\x00\x00\x00\x00\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11')
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
Can second example be loaded by Apple tools on 32-bit? |
|