BUG: gh-10882 may have broken ctypes compatibility in older versions of python
See original GitHub issue#10882 changed the behavior of np.array
from.
- Try to get a PEP3118 buffer interface
- Try to convert the buffer interface into an array
- If the buffer interface is not correct, try
__array_interface__
instead - sometimes call
abort()
due to bad error silencing (#6741)
- If there’s no buffer interface, try
__array_interface__
instead
To
- Try to get a PEP3118 memory view
- Try to convert the buffer interface into an array
- If the buffer interface is not correct, fail and tell the user that something is wrong
- If there’s no buffer interface, try
__array_interface__
instead
This means that objects which incorrectly implement the buffer interface now fail loudly, rather than silently-or-with-abort().
Unfortunately, prior to python/cpython#31, (before 2.7.14 / 3.6.3 / 3.7.0) ctypes did not implement the buffer interface correctly for integer types (the format and itemsize didn’t match)
Do we have a minimum supported patch version of python? If so, should we enable tests for it so that this doesn’t happen again?
Issue Analytics
- State:
- Created 5 years ago
- Comments:16 (15 by maintainers)
Top Results From Across the Web
ctypes: fail to create a _ctypes._SimpleCData subclass using ...
While investigating a bug report in one of my libraries ... I've come across a behaviour that appears in Python 3.6 but not...
Read more >Install via pacman to specific version of Python - Stack Overflow
You would need to make sure all the other installed packages are compatible. I am using PyInstaller with Python 3.8 in MSYS2 without...
Read more >Homebrew, pyenv, ctypes... oh my! - DEV Community
I generally use pyenv to manage Python versions, and Homebrew to ... From the broken directory, I could run make and see the...
Read more >T84752 Crash using 'ctypes' (fixed in Python >= 3.8), causes ...
Author: Jimmy Hazevoet. Blender Version Broken: 2.91.0, branch: master, commit date: ... Can you please try to start Blender with the following command:....
Read more >Install Python on macOS 11 M1 (Apple Silicon) using pyenv
macOS 11 comes with a default version of python2, which is now obsolete in favor of python3. Python2 reached end of life in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I could try tweaking #10882 to have a special case for ctypes objects,
I also stumbled on this: I have unrelated buffer interface (inherited from ctypes impl) and my custom array_interface that I’d like to be used