Message 336769 - Python tracker (original) (raw)
I'm not sure if either of these patches got merged, but at some point this was fixed:
Python 3.7.2 (default, Feb 9 2019, 13🔞43)
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> from decimal import Decimal
>>> datetime.utcfromtimestamp(Decimal(123456.0))
datetime.datetime(1970, 1, 2, 10, 17, 36)
I recommend that someone add some regression tests to this, then we can close the issue.
I'm also going to mark this as "easy" since adding tests for this particular example should be pretty simple.