Commit 30cde45e authored by Greg Thompson's avatar Greg Thompson Committed by LUCI CQ

Fix error handling in case of unicode decode error.

Commit 6fc394f9 added some diagnostics, but it didn't quite work out the
way it was planned.

Bug: 1210746
Change-Id: Ia4f30606e87d3f8b1362441bd74bb7ed0f5ca886
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2928771
Auto-Submit: Greg Thompson <grt@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: 's avatarDirk Pranke <dpranke@google.com>
parent 424504a1
......@@ -1006,7 +1006,7 @@ class AffectedFile(object):
self.AbsoluteLocalPath(), 'rU').splitlines()
except IOError:
pass # File not found? That's fine; maybe it was deleted.
except UnicodeDecodeError:
except UnicodeDecodeError as e:
# log the filename since we're probably trying to read a binary
# file, and shouldn't be.
print('Error reading %s: %s' % (self.AbsoluteLocalPath(), e))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment