You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
memoryview on array with datetime/timedelta-dtype triggers SystemError on Python 3.5 #7270
On Python 3.5, constructing a memoryview for an ndarray containing a datetime/timedelta-dtype leads to a SystemError: <class 'memoryview'> returned a result with an error set:
In [50]: memoryview(numpy.zeros(10, dtype=[("A", "m8[s]")]))
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
ValueError: cannot include dtype 'm' in a buffer
During handling of the above exception, another exception occurred:
SystemError Traceback (most recent call last)
<ipython-input-50-5d5ac6c085fa> in <module>()
----> 1 memoryview(numpy.zeros(10, dtype=[("A", "m8[s]")]))
SystemError: <class 'memoryview'> returned a result with an error set
Yes, this is an upstream bug. It seems that memoryview() is setting an error but returning a non-null result. Handling of this case changed in Python 3.5, so the SystemError is expected behavior.
Activity
gerritholl commentedon Feb 17, 2016
Or should this still be considered an upstream bug?
augurar commentedon Aug 10, 2016
Yes, this is an upstream bug. It seems that
memoryview()is setting an error but returning a non-null result. Handling of this case changed in Python 3.5, so theSystemErroris expected behavior.eric-wieser commentedon Mar 1, 2019
I can't reproduce this any more in 1.15.4, despite the fact that nothing seems to have changed upstream.