Author Justin Blanchard
Recipients Justin Blanchard
Date 2019-06-22.16:15:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561220113.72.0.97808916119.issue37372@roundup.psfhosted.org>
In-reply-to
Content
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!
History
Date User Action Args
2019-06-22 16:15:13Justin Blanchardsetrecipients: + Justin Blanchard
2019-06-22 16:15:13Justin Blanchardsetmessageid: <1561220113.72.0.97808916119.issue37372@roundup.psfhosted.org>
2019-06-22 16:15:13Justin Blanchardlinkissue37372 messages
2019-06-22 16:15:13Justin Blanchardcreate