[issue23521] OverflowError from timedelta * float in datetime.py

Alexander Belopolsky report at bugs.python.org
Wed Feb 25 18:22:28 CET 2015


Alexander Belopolsky added the comment:

Attached patch fixes the issue, but produces a slightly different result:

>>> timedelta(seconds=1)*0.6112295
datetime.timedelta(0, 0, 611230)

Note that C implementation is probably buggy:

>>> from datetime import *
>>> timedelta(seconds=1)*0.6112295
datetime.timedelta(0, 0, 611229)
>>> timedelta(seconds=0.6112295)
datetime.timedelta(0, 0, 611230)

See msg194311  in #8860.

----------
keywords: +patch
Added file: http://bugs.python.org/file38234/issue23521.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23521>
_______________________________________


More information about the Python-bugs-list mailing list