[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Yhojann Aguilera
Yhojann Aguilera added the comment: For big files (like as >= 1gb) can not load the all string on memory, need use a file stream using open(). -- ___ Python tracker ___ _

[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: There is an option to work with binary: with open(filename, 'rb') as f: bin_data = f.read() str_data = bin_data.decode('latin-1') -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Yhojann Aguilera
Yhojann Aguilera added the comment: Thanks, works fine, but anyway why not give the option to work binary? the delimiters can be represented with binary values. In python it is difficult to autodetect the encoding of characters in a file. -- ___ P

[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Try passing an "encoding" argument to open(): with open('./exported.csv', newline='', encoding='latin-1') as csvFileHandler: ... -- nosy: +rhettinger ___ Python tracker _

[issue37984] Unable parse csv on latin iso or binary mode

2019-08-29 Thread Yhojann Aguilera
New submission from Yhojann Aguilera : Unable parse a csv with latin iso charset. with open('./exported.csv', newline='') as csvFileHandler: csvHandler = csv.reader(csvFileHandler, delimiter=';', quotechar='"') for line in csvHandler: UnicodeDecodeError: 'utf-8' codec