Fix T74959: Need to be explicit about UTF8 encoding in py.

Because some OSs are still using old 8bits specific encodings... Angry
eye @windows...
This commit is contained in:
Bastien Montagne
2020-03-20 20:49:48 +01:00
parent 3d9d132ccd
commit 9607e54985
4 changed files with 8 additions and 8 deletions

View File

@@ -765,7 +765,7 @@ def dump_src_messages(msgs, reports, settings):
}
data = ""
with open(path) as f:
with open(path, encoding="utf8") as f:
data = f.read()
for srch in pygettexts:
m = srch(data)
@@ -798,7 +798,7 @@ def dump_src_messages(msgs, reports, settings):
forbidden = set()
forced = set()
if os.path.isfile(settings.SRC_POTFILES):
with open(settings.SRC_POTFILES) as src:
with open(settings.SRC_POTFILES, encoding="utf8") as src:
for l in src:
if l[0] == '-':
forbidden.add(l[1:].rstrip('\n'))