Extended exception handling to be a bit more verbose about unicode bugs.

This commit is contained in:
Jannis Leidel
2011-08-26 12:21:14 +02:00
parent 8da15c0d47
commit bf8a1e0ca8

View File

@@ -85,6 +85,11 @@ class Compressor(object):
except IOError, e:
raise UncompressableFileError("IOError while processing "
"'%s': %s" % (filename, e))
except UnicodeDecodeError, e:
raise UncompressableFileError("UnicodeDecodeError while "
"processing '%s' with "
"charset %s: %s" %
(filename, charset, e))
@cached_property
def parser(self):