commit | 979c016ddf083989d005c5d2f48619ec5c24ba47 | [log] [tgz] |
---|---|---|
author | Daniel Gruno <humbedooh@apache.org> | Sat Aug 14 08:23:53 2021 +0200 |
committer | GitHub <noreply@github.com> | Sat Aug 14 08:23:53 2021 +0200 |
tree | eabc5812987de3162c147b1c51025c0ef35651a0 | |
parent | deeef81876d8b9243212f02db860a4acd9022966 [diff] |
treat encoding error as io error, close file
diff --git a/loggy.py b/loggy.py index a77eb8c..6378183 100644 --- a/loggy.py +++ b/loggy.py
@@ -276,9 +276,7 @@ rd += len(line) data += line self.parse_line(path, data) - except UnicodeDecodeError: - pass # Couldn't decipher this line, ignore it. - except IOError: + except (IOError, UnicodeDecodeError): try: self.file_handles[path].close() except IOError: