Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix EncodingWarning in Tools/freeze/test/freeze.py
  • Loading branch information
methane committed Nov 24, 2021
commit a5c54e278935848d7c2034dffced66de81bd878d
4 changes: 2 additions & 2 deletions Tools/freeze/test/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_makefile_var(builddir, name):
regex = re.compile(rf'^{name} *=\s*(.*?)\s*$')
filename = os.path.join(builddir, 'Makefile')
try:
infile = open(filename)
infile = open(filename, encoding='utf-8')
except FileNotFoundError:
return None
with infile:
Expand Down Expand Up @@ -125,7 +125,7 @@ def prepare(script=None, outdir=None):
if script:
scriptfile = os.path.join(outdir, 'app.py')
print(f'creating the script to be frozen at {scriptfile}')
with open(scriptfile, 'w') as outfile:
with open(scriptfile, 'w', encoding='utf-8') as outfile:
outfile.write(script)

# Make a copy of the repo to avoid affecting the current build
Expand Down