Message346284
Under bpo-22005, Python 3 gained support for unpickling datetime data from Python 2. (Thanks!) It turns out the input validation isn't quite right: it bombs on datetime.time when the encoded seconds (not hours) field is >=24:
python2>>> datetime.time(1, 2, 3).__reduce__()
(<type 'datetime.time'>, ('\x01\x02\x03\x00\x00\x00',))
python2>>> datetime.time(23, 24, 25).__reduce__()
(<type 'datetime.time'>, ('\x17\x18\x19\x00\x00\x00',))
python3>>> datetime.time('\x01\x02\x03\x00\x00\x00')
datetime.time(1, 2, 3)
python3>>> datetime.time('\x17\x18\x19\x00\x00\x00')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: an integer is required (got type str)
I would like to contribute a fix and will be opening a PR. This is my first contribution - any help and patience appreciated! |
|
Date |
User |
Action |
Args |
2019-06-22 16:15:13 | Justin Blanchard | set | recipients:
+ Justin Blanchard |
2019-06-22 16:15:13 | Justin Blanchard | set | messageid: <1561220113.72.0.97808916119.issue37372@roundup.psfhosted.org> |
2019-06-22 16:15:13 | Justin Blanchard | link | issue37372 messages |
2019-06-22 16:15:13 | Justin Blanchard | create | |
|