MAINT: __array_interface__ data address cannot be bytes#17241
Conversation
The old version 1 ``__array_interface__`` implementation allowed the data pointer value to be passed as a string, in version 2 an integer was required, but the old code accepting a string remained. Remove that bit of code from PyArray_FromInterface.
eric-wieser
left a comment
There was a problem hiding this comment.
Patch looks fine, I'm ok with this if we think we can get away with skipping a deprecation warning.
__array_interface__ data address cannot be string.__array_interface__ data address cannot be bytes
|
@eric-wieser It's a bit of a gamble, but I think it is pretty safe. Folks making the transition to Python 3 would probably have noticed if they were using strings. I need to add a release note though. |
There was a problem hiding this comment.
| The ``__array_interface__`` data tuple first element must be an integer | |
| The first element of the ``__array_interface__["data"]`` tuple must be an integer |
31d7e6f to
14f2a1d
Compare
|
Updated. |
|
I am OK with giving this a shot. Will probably merge this tomorrow, unless anyone has reason to be more cautious? Getting the correct string seems so tricky, that I am unsure where it would arise, besides maybe debugging where you copy paste a pointer representation?! The main danger would be some library actually relying on it creating issues for a small group of third party users. |
The old version 1
__array_interface__implementation allowed thedata pointer value to be passed as a string, in version 2 an integer was
required, but the old code accepting a string remained. Remove that bit
of code from PyArray_FromInterface.