Explicitly specify encoding when opening text files in Python code
This commit is contained in:
1 parent
fa4b9065a8
commit
634bd97001
19 files changed
+38
-38
No files matched your search
@@ -152,7 +152,7 @@ def main():
|
||||
sys.exit(p.returncode)
|
||||
|
||||
if not args.i:
|
||||
with open(filename) as f:
|
||||
with open(filename, encoding="utf8") as f:
|
||||
code = f.readlines()
|
||||
formatted_code = io.StringIO(stdout).readlines()
|
||||
diff = difflib.unified_diff(code, formatted_code,
|
||||
|
||||
Reference in new issue
Block a user