Explicitly specify encoding when opening text files in Python code

This commit is contained in:
practicalswift committed 2018-06-12 21:34:52 +02:00
1 parent fa4b9065a8
commit 634bd97001
19 files changed
+38 -38

No files matched your search

+1 -1
View File
@@ -37,7 +37,7 @@ for arg in sys.argv[1:]:
# TODO: implement support for multiple include directories
for arg in sorted(files.keys()):
module = files[arg]
with open(arg, 'r') as f:
with open(arg, 'r', encoding="utf8") as f:
for line in f:
match = RE.match(line)
if match: