as this bug is open for 4 years now, I spent the afternoon fixing it. The solution was quite easy.
The auto generated wrapping from the .defs file is not sufficient. I added a method to the .override file, which solves the problem.
The problem was, that the C function requires a char pointer (which is not \x00 terminated) and the length. But the automatic mapping interpreted it as a null terminated string and therefore threw a TypeError (because pdf documents typically contain null bytes).
I fixed the mapping by changing "si" to "s#" (http://docs.python.org/c-api/arg.html), which allows null bytes and also renders the length parameter redundant. Therefore I removed it as Benjamin suggested.
As this method probably never worked, there should be no fear to remove the length parameter when thinking about backward compatibility.
Ok,
as this bug is open for 4 years now, I spent the afternoon fixing it. The solution was quite easy.
The auto generated wrapping from the .defs file is not sufficient. I added a method to the .override file, which solves the problem.
The problem was, that the C function requires a char pointer (which is not \x00 terminated) and the length. But the automatic mapping interpreted it as a null terminated string and therefore threw a TypeError (because pdf documents typically contain null bytes).
I fixed the mapping by changing "si" to "s#" (http:// docs.python. org/c-api/ arg.html), which allows null bytes and also renders the length parameter redundant. Therefore I removed it as Benjamin suggested.
As this method probably never worked, there should be no fear to remove the length parameter when thinking about backward compatibility.
Have a nice evening.