Severe bug in Python bindings

Hello there,

I found a severe problem in the Python bindings for the FrontPanel dll.
The problem is that the ReadFromBlockPipeOut() function expects a Python string as the third argument. This string will by modified by the function call so that it contains the data read from the pipe.

However, Python strings are immutable and should be treated as such also by the C api.
Mutating a Python string can (and will, sooner or later) lead to unexpected behaviour.

Hello theller–

I suppose the severity depends on perspective but yes, we treat the string as mutable from the API perspective for now. Our expectation is to change this to bytearray which was back-ported to Python 2.6 but we haven’t gotten around to it yet.

No problems have been reported so far with this implementation, although, strictly speaking it is questionable.

Have you considered writing a ctypes-binding instead of using swig? This would make the binding independent from the Python version…