Message232112
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? |
|
Date |
User |
Action |
Args |
2014-12-04 08:43:40 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ronaldoussoren, belopolsky, ned.deily, Connor.Wolf |
2014-12-04 08:43:40 | serhiy.storchaka | set | messageid: <1417682620.45.0.127707715277.issue22993@psf.upfronthosting.co.za> |
2014-12-04 08:43:40 | serhiy.storchaka | link | issue22993 messages |
2014-12-04 08:43:40 | serhiy.storchaka | create | |
|