fix encoding for _GetYapfIgnorePatterns so it supports utf-8
Bug: 1204441
Change-Id: I36b963d69b5dec9e609258055b800b14d398b2b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2864013
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Anthony Polito <apolito@google.com>
diff --git a/git_cl.py b/git_cl.py
index 87904a9..fc77ef8 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -666,13 +666,12 @@
if not os.path.exists(yapfignore_file):
return ignore_patterns
- with open(yapfignore_file) as f:
- for line in f.readlines():
- stripped_line = line.strip()
- # Comments and blank lines should be ignored.
- if stripped_line.startswith('#') or stripped_line == '':
- continue
- ignore_patterns.add(stripped_line)
+ for line in gclient_utils.FileRead(yapfignore_file).split('\n'):
+ stripped_line = line.strip()
+ # Comments and blank lines should be ignored.
+ if stripped_line.startswith('#') or stripped_line == '':
+ continue
+ ignore_patterns.add(stripped_line)
return ignore_patterns