mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 12:07:51 +02:00
Make config/presubmits.py use explicit encodings (#908)
For some reason, our docker build image has started using a non-utf8 default encoding. Specify the encoding explicitly on python "open()" to override. Note that this might not entirely fix the build: it's possible that this problem may affect other portions of the build.
This commit is contained in:
parent
808b6a2a11
commit
f782b91dc4
1 changed files with 2 additions and 2 deletions
|
@ -65,7 +65,7 @@ class PresubmitCheck:
|
||||||
for pattern in self.skipped_patterns:
|
for pattern in self.skipped_patterns:
|
||||||
if pattern in file:
|
if pattern in file:
|
||||||
return False
|
return False
|
||||||
with open(file, "r") as f:
|
with open(file, "r", encoding='utf8') as f:
|
||||||
file_content = f.read()
|
file_content = f.read()
|
||||||
matches = re.match(self.regex, file_content, re.DOTALL)
|
matches = re.match(self.regex, file_content, re.DOTALL)
|
||||||
if self.regex_type == FORBIDDEN:
|
if self.regex_type == FORBIDDEN:
|
||||||
|
@ -241,7 +241,7 @@ def verify_flyway_index():
|
||||||
|
|
||||||
# Remove the sequence numbers and compare against the index file contents.
|
# Remove the sequence numbers and compare against the index file contents.
|
||||||
files = [filename[1] for filename in sorted(files)]
|
files = [filename[1] for filename in sorted(files)]
|
||||||
with open('db/src/main/resources/sql/flyway.txt') as index:
|
with open('db/src/main/resources/sql/flyway.txt', encoding='utf8') as index:
|
||||||
indexed_files = index.read().splitlines()
|
indexed_files = index.read().splitlines()
|
||||||
if files != indexed_files:
|
if files != indexed_files:
|
||||||
unindexed = set(files) - set(indexed_files)
|
unindexed = set(files) - set(indexed_files)
|
||||||
|
|
Loading…
Add table
Reference in a new issue