civisanalytics / civis-python

Civis API Python Client
BSD 3-Clause "New" or "Revised" License
34 stars 26 forks source link

Encoding Error #268

Closed alexm1309 closed 5 years ago

alexm1309 commented 6 years ago

When using read_civis() on a table that contains accented characters, the function will fail with a UnicodeDecodeError even if you specify the encoding argument.

So something like

civis.io.read_civis(table='schema.table_with_accented_characters', database='Database Name', use_pandas=False, encoding='latin-1')

Will fail with:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 106622: unexpected end of data

It sounds like we do some utf-8 encoding before the client reads the kwargs of read_civis() and that's where the error is surfacing.

stephen-hoover commented 5 years ago

I haven't been able to reproduce this error. Please reopen with a reproducible example if it happens again.