Error handling: unknown encoding
rdaumann opened this issue · 1 comments
When I run the program with an unknown encoding it throws an error and shows me the stacktrace. Instead I would like to see a clear error message "Unkown encoding XXX.".
icdiff --encoding=ISO-8859 file1 file2
Traceback (most recent call last):
File "/usr/local/bin/icdiff", line 726, in
start()
File "/usr/local/bin/icdiff", line 577, in start
diff(options, *args)
File "/usr/local/bin/icdiff", line 600, in diff
diff_files(options, a, b)
File "/usr/local/bin/icdiff", line 670, in diff_files
lines_a = read_file(a, options)
File "/usr/local/bin/icdiff", line 629, in read_file
with codecs.open(fname, encoding=options.encoding, mode="rb") as inf:
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 887, in open
info = lookup(encoding)
LookupError: unknown encoding: ISO-8859
Fixed by #147 and will be in 1.9.5 today