[pypy-issue] [issue1276] PyBuffer_FillInfo() and readonly parameter

Lisandro Dalcin tracker at bugs.pypy.org
Wed Oct 3 16:40:34 CEST 2012

New submission from Lisandro Dalcin <dalcinl at gmail.com>:

I understand the implementation of PyBuffer_FillInfo() is incomplete, but at 
least it is enough to pass back and forth raw buffers in C code. However, there 
is an issue with the handling of the "readonly" parameter: PyPy ignores 
"readonly" parameter and set view.readonly depening on PyBUF_WRITABLE bitfield 
in "flags" parameter.

The correct behavior is to generate an error if readonly=1 and 
flags&PyBUF_WRITABLE, and set view.readonly = readonly. 

I was able to workaround this issue with a bit of C monkeypatching: 

PS: http://mail.python.org/pipermail/cython-devel/2012-October/003177.html

messages: 4816
nosy: dalcinl, pypy-issue
priority: bug
status: unread
title: PyBuffer_FillInfo() and readonly parameter

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list