Allow converting an image to a numpy array to raise errors#5379
Allow converting an image to a numpy array to raise errors#5379hugovk merged 1 commit intopython-pillow:masterfrom
Conversation
|
Thanks for chasing up. Let's open an issue at NumPy as well?
Maybe they won't have it deprecated and fixed by the next Pillow release in 3 months but let's at least give them a chance, and review this before release. I've added it to the 8.3.0 milestone. |
|
Ok, raised at numpy/numpy#18723 |
|
NumPy 1.21 will deprecate the error catching, raising a warning in this situation. It is expected that NumPy 1.23, a year later, would start to raise an error. |
|
Thanks for following up! |
|
numpy/numpy#20835 has been merged into NumPy, so NumPy 1.23.should raise an error. |
|
NumPy 1.23 has been released, so I've created #6394 to revert this. |
Resolves #5084
The following code runs without raising an error.
Even though an OSError is raised if
__array_interface__is accessed directly.This is a bug in numpy.
This PR works around that bug by replacing
__array_interface__with__array__.