Fixed PLW1514 (unspecified-encoding): open in text mode without explicit encoding argument

This commit is contained in:
Teal Dulcet
2024-03-10 07:56:49 -04:00
committed by Joshua Tauberer
parent a02b59d4e4
commit 0e9193651d
12 changed files with 44 additions and 44 deletions
+2 -2
View File
@@ -76,7 +76,7 @@ for setting in settings:
found = set()
buf = ""
with open(filename) as f:
with open(filename, encoding="utf-8") as f:
input_lines = list(f)
while len(input_lines) > 0:
@@ -144,7 +144,7 @@ for i in range(len(settings)):
if not testing:
# Write out the new file.
with open(filename, "w") as f:
with open(filename, "w", encoding="utf-8") as f:
f.write(buf)
else:
# Just print the new file to stdout.