harelba / q

q - Run SQL directly on delimited files and multi-file sqlite databases
http://harelba.github.io/q/
GNU General Public License v3.0
10.19k stars 421 forks source link

Running without choosing encoding on an iso-8859 file fails with a traceback #253

Open harelba opened 3 years ago

harelba commented 3 years ago

The AttributeError("'UnicodeDecodeError' object has no attribute 'message'") is being written to stderr, instead of a proper encoding warning.

clsn commented 3 years ago

This is because the program handles a ValueError by catching it and printing out the message attribute, but UnicodeDecodeError is a subclass of ValueError and lacks a message attribute. UnicodeDecodeError needs to be caught before ValueError. Will try to file a PR soon.