[issue34023] timedelta(seconds=x) strange results when type(x) == np.int32

2020-06-07 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34023] timedelta(seconds=x) strange results when type(x) == np.int32

2020-06-07 Thread Zackery Spytz


Zackery Spytz  added the comment:

Python 2 is EOL, so I think this issue should be closed.

--
nosy: +ZackerySpytz

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34023] timedelta(seconds=x) strange results when type(x) == np.int32

2018-07-05 Thread Paul Ganssle


Change by Paul Ganssle :


--
nosy: +p-ganssle

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34023] timedelta(seconds=x) strange results when type(x) == np.int32

2018-07-02 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +belopolsky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34023] timedelta(seconds=x) strange results when type(x) == np.int32

2018-07-02 Thread Mark Dickinson


New submission from Mark Dickinson :

On Python 2.x on Windows, creating a timedelta with an `np.int32` instance for 
the number of seconds can (somewhat) silently give wrong results.

Enthought Deployment Manager -- https://www.enthought.com
Python 2.7.13 |Enthought, Inc. (x86_64)| (default, Mar  2 2017, 16:05:12) [MSC 
v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> import datetime
>>> datetime.timedelta(seconds=np.int32(123456789))
__main__:1: RuntimeWarning: overflow encountered in long_scalars
datetime.timedelta(-1, 84354, 76480)

There's at least a warning from NumPy there as NumPy attempts to scale the 
np.int32 by 10**6, but depending on settings and on how the code is invoked, 
the user may not see that warning.

This is not an issue on Python 3.x / Windows or on Python 2.x / Unix; in both 
those cases, the same code gives a TypeError.

This is related to, but not the same as, #5476.

This may well count as a "won't fix", but it seemed at least worth reporting.

--
components: Extension Modules
messages: 320884
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: timedelta(seconds=x) strange results when type(x) ==  np.int32
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com