-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ctypeslib.as_array aborts #6741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Works here on Python 2.7.10 debug. |
Can reproduce on 3.4. |
Also with numpy 1.9.3 and 3.4 debug, so not a regression. |
Not totally sure, but have a strong feeling this may be related to these types of problems ( #6990 ). |
Ran this with |
@PolarNick239: In Python 3.x, it appears they have taken a stricter stance on Python exception handling in C. Namely, they encourage (by way of assertions) us to handle an exception before calling any function that might raise another one. In some cases, CPython has been found to be violating this and we have started finding errors of our own where we are violating this. I am not sure who is responsible in this case. |
Thanks for explanation! :) |
Fixes numpygh-6741 If an object claims to support the PEP3118 buffer protocol, then any mistakes in the implementation should be raised as errors, rather than falling back on other approaches. This has some behavior changes: * np.array(mem_view_33d) now gives a more useful error message than "memoryview: unsupported format <B" * np.array(ctypes_pointer) now errors rather than creating an object array containing a single pointer Also adds support for 32-dimensional buffers, where previously the max was 31-dimensional.
This script fails:
python 3.4.2-dbg
numpy==1.10.1
Ubuntu 14.10
python3.4: ../Objects/abstract.c:2077: PyObject_Call: Assertion '(result != ((void *)0) && !PyErr_Occurred()) || (result == ((void *)0) && PyErr_Occurred())' failed.
Can you please explain why?
P.S. may be it can help:
If
sh = (1, 1)
change tosh = 239
:TypeError: shape must be a tuple
The text was updated successfully, but these errors were encountered: