Message336771
| Author |
p-ganssle |
| Recipients |
SilentGhost, Steven Davidson, anglister, belopolsky, lemburg, p-ganssle, serhiy.storchaka, skrah, vstinner |
| Date |
2019年02月27日.17:10:29 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1551287429.2.0.116112410519.issue23607@roundup.psfhosted.org> |
| In-reply-to |
| Content |
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. |
|