Skip to content

Commit

Permalink
Fix EncodingWarning in Tools/freeze/test/freeze.py (GH-29742)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane authored Nov 30, 2021
1 parent bd9342d commit 9a5dec4
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 9a5dec4

Please sign in to comment.