summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2016-09-15 14:02:37 +0200
committerThibault Saunier <thibault.saunier@osg.samsung.com>2016-09-17 10:09:30 -0300
commitf47cfd960028fd8be3a15e6e820ff7958f92a58c (patch)
treeb6847e120ccfdc8d28275381c37ba5500b50ee1e
parentcee90a8d2876b52d347d617627c7771f6247c923 (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-xgit-phab2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-phab b/git-phab
index ce901fc..9978621 100755
--- a/git-phab
+++ b/git-phab
@@ -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