Message336771
Oh actually that's my mistake. I can't reproduce the failure in the constructor in the Python version of the module, and also it seems to be fixed in the pure Python version as of at least 3.6:
Python 3.6.7 (default, Oct 25 2018, 16:11:17)
[GCC 8.2.1 20180831] on linux
>>> import sys
>>> sys.modules['_datetime'] = None
>>> from decimal import Decimal as D
>>> from datetime import datetime
>>> datetime.utcfromtimestamp(D(123456.12345))
datetime.datetime(1970, 1, 2, 10, 17, 36, 123450)
But the truncation behavior is still present in the C version as of Python 3.8.0a1+:
Python 3.8.0a1+ (heads/master:3766f18, Feb 11 2019, 12:52:31)
[GCC 8.2.1 20181127] on linux
>>> from datetime import datetime
>>> from decimal import Decimal as D
>>> datetime.utcfromtimestamp(D(123456.12345))
datetime.datetime(1970, 1, 2, 10, 17, 36)
I still think we need a test for the constructor behavior, but I'm going to remove "easy", since we still need to fix truncation in the C version. |
|
| Date |
User |
Action |
Args |
| 2019-02-27 17:10:29 | p-ganssle | set | recipients:
+ p-ganssle, lemburg, belopolsky, vstinner, SilentGhost, skrah, serhiy.storchaka, anglister, Steven Davidson |
| 2019-02-27 17:10:29 | p-ganssle | set | messageid: <1551287429.2.0.116112410519.issue23607@roundup.psfhosted.org> |
| 2019-02-27 17:10:29 | p-ganssle | link | issue23607 messages |
| 2019-02-27 17:10:29 | p-ganssle | create | |
|