frictionlessdata / tabulator-py

Python library for reading and writing tabular data via streams.
https://frictionlessdata.io
MIT License
235 stars 42 forks source link

Tabulator should wrap underlaying encoding errors into better error messages #307

Closed roll closed 4 years ago

roll commented 4 years ago

Overview

E.g. here the encoding was detected not correctly:

  File "/home/roll/projects/tabulator-py/tabulator/parsers/csv.py", line 108, in __prepare_dialect
    sample.append(next(stream))
  File "/home/roll/projects/tabulator-py/.python/lib/python3.7/encodings/cp1254.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 37396: character maps to <undefined>