Issue 33296: datetime.datetime.utcfromtimestamp call decimal causes precision loss (original) (raw)

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 , 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:59 admin set github: 77477
2018-05-09 05:30:52 anglister set messages: +
2018-05-09 05:24:25 anglister set messages: +
2018-05-05 13:32:26 serhiy.storchaka set status: open -> closedsuperseder: Inconsistency in datetime.utcfromtimestamp(Decimal)messages: + resolution: duplicatestage: resolved
2018-05-05 13:24:37 corona10 set nosy: + serhiy.storchaka, corona10messages: +
2018-04-17 09:43:08 anglister set messages: +
2018-04-17 09:16:46 anglister create