Open hneiva opened 7 years ago
cffi requires unicode to be wchar *
as far as I recall.
For reference:
I'm not experienced enough with Python or C to have a better look at it. Anyone has a way around this?
It seems that the line is not being encoded into the connection encoding before being given to PQputCopyData. (Python unicode objects don't have a single obvious C representation; you need to encode them into a bytes object in some specific encoding before giving them to C code. The note in the psycopg2 docs suggests that the correct encoding is the postgres connection encoding, which seems reasonable.)
Getting the following error:
Notes:
output
is aStringIO
in this caseoutput
is small (a few records)output.pos
seems to always be at 8192 (which hints at buffering)