[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-23 Thread Brett Cannon
Brett Cannon added the comment: This isn't a bug because the CSV format isn't malformed (which would be appropriate for csv.Error), but the file itself isn't appropriate encoded (or the proper encoding wasn't specified (hence UnicodeDecodeError). So the exception is appropriate. And we do n

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I don't think all errors can be documented, csv iterate over the object but has no idea what it is. When writing for example, anything could happen, from a socket timing out, permissions errors, the underlying media being removed not properly, the media having

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread alter-bug-tracer
alter-bug-tracer added the comment: Shouldn't all of them be documented? Either that, or converted to csv.Error? Take, for example, the C++ std. -- ___ Python tracker ___ ___

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: I don't understand the issue here, csv can raise many errors when an issue happens: >>> import csv >>> csv.reader(None) Traceback (most recent call last): File "", line 1, in TypeError: argument 1 must be an iterator Why would UnicodeDecodeError not be appro

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
Change by Rémi Lapeyre : Added file: https://bugs.python.org/file48344/file1.txt ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
Change by Rémi Lapeyre : Added file: https://bugs.python.org/file48342/csv_parser.py ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-21 Thread Rémi Lapeyre
Change by Rémi Lapeyre : Added file: https://bugs.python.org/file48343/file0.txt ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue36975] csv: undocumented UnicodeDecodeError on malformed file

2019-05-20 Thread alter-bug-tracer
New submission from alter-bug-tracer : UnicodeDecodeError is thrown instead of csv.Error when parsing malformed inputs. Examples: 1. file0 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 0: invalid continuation byte Traceback (most recent call last): File "csv_parser.py",