Skip to content
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

ARROW-3228: [Python] Do not allow PyObject_GetBuffer to obtain non-readonly Py_buffer when pyarrow Buffer is not mutable #2567

wants to merge 1 commit into from


Copy link

wesm commented Sep 15, 2018

NumPy tries to obtain a writable buffer to determine mutability. This was passing silently:

…when pyarrow.Buffer is not writable

Change-Id: I4d644e08e633dd8b6dcc420de9e3d975219d91e0

This comment has been minimized.

Copy link
Member Author

wesm commented Sep 15, 2018

if flags & cp.PyBUF_WRITABLE:
raise BufferError("Writable buffer requested but Arrow "
"buffer was not mutable")
buffer.readonly = 1
buffer.buf = <char *>self.buffer.get().data()

This comment has been minimized.

Copy link

wesm Sep 15, 2018

Author Member

This cast is evil because it was removing const

pitrou approved these changes Sep 15, 2018
Copy link

pitrou left a comment


@wesm wesm closed this in 4121c5a Sep 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.