This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: datetime.datetime.utcfromtimestamp call decimal causes precision loss
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.4, Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Inconsistency in datetime.utcfromtimestamp(Decimal)
View: 23607
Assigned To: Nosy List: anglister, corona10, serhiy.storchaka
Priority: normal Keywords:

Created on 2018-04-17 09:16 by anglister, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
timestamp_decimal_test.py anglister, 2018-04-17 09:16 test
Messages (6)
msg315385 - (view) Author: Shlomo Anglister (anglister) * Date: 2018-04-17 09:16
Output for python2.7.11

2018-04-12-05:23:08.436252
2018-04-12-05:23:08.436252

Output for python3.4 and python3.6

2018-04-12-05:23:08.436252
2018-04-12-05:23:08.000000
msg315386 - (view) Author: Shlomo Anglister (anglister) * Date: 2018-04-17 09:43
The test code demonstrates that fromutctimestamp(1523510588.436252000) != fromutctimestamp(Decimal(1523510588.436252000))

This is related to issues: 22627 and 23607
but not a duplicate
msg316209 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2018-05-05 13:24
Looks like this issue is related with bpo-23607.

Since a decimal object is failed on PyFloat_Check(obj) of _PyTime_ObjectToDenominator,
This regression bug is happened due to no chance to get float value from a Decimal object.
https://bugs.python.org/issue23607

@serhiy.storchaka
What do you think?
msg316211 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-05-05 13:32
I think this issue is not just related to issue23607, but a duplicate of it.
msg316309 - (view) Author: Shlomo Anglister (anglister) * Date: 2018-05-09 05:24
Thanks @serhiy.storchaka and @corona10 !
I read it, documented the relation and failed to see the duplication.
msg316310 - (view) Author: Shlomo Anglister (anglister) * Date: 2018-05-09 05:30
This issue is in review stage for a long time.
What's holding it?

On Wed, May 9, 2018 at 8:24 AM, Shlomo Anglister <report@bugs.python.org>
wrote:

>
> Shlomo Anglister <shlomo.anglister@gmail.com> added the comment:
>
> Thanks @serhiy.storchaka and @corona10 !
> I read it, documented the relation and failed to see the duplication.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue33296>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:58:59adminsetgithub: 77477
2018-05-09 05:30:52anglistersetmessages: + msg316310
2018-05-09 05:24:25anglistersetmessages: + msg316309
2018-05-05 13:32:26serhiy.storchakasetstatus: open -> closed
superseder: Inconsistency in datetime.utcfromtimestamp(Decimal)
messages: + msg316211

resolution: duplicate
stage: resolved
2018-05-05 13:24:37corona10setnosy: + serhiy.storchaka, corona10
messages: + msg316209
2018-04-17 09:43:08anglistersetmessages: + msg315386
2018-04-17 09:16:46anglistercreate