diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2016-09-15 14:02:37 +0200 |
---|---|---|
committer | Thibault Saunier <thibault.saunier@osg.samsung.com> | 2016-09-17 10:09:30 -0300 |
commit | f47cfd960028fd8be3a15e6e820ff7958f92a58c (patch) | |
tree | b6847e120ccfdc8d28275381c37ba5500b50ee1e | |
parent | cee90a8d2876b52d347d617627c7771f6247c923 (diff) |
get_changes_for_diff: ignore UnicodeDecodeError
If, for some reason, blob_is_binary() failed to detect that the file is
actually a binary, best to silently ignore it than crash on
UnicodeDecodeError exception.
Reviewed-by: Thibault Saunier <tsaunier@gnome.org>
Differential Revision: https://phabricator.freedesktop.org/D1304
-rwxr-xr-x | git-phab | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -783,7 +783,7 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri) with open(fname) as f: for i, l in enumerate(f): pass - except (FileNotFoundError, IsADirectoryError): + except (FileNotFoundError, IsADirectoryError, UnicodeDecodeError): return 0 return i + 1 |