Skip to content

Commit 9a5dec4

Browse files
authored
Fix EncodingWarning in Tools/freeze/test/freeze.py (GH-29742)
1 parent bd9342d commit 9a5dec4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tools/freeze/test/freeze.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_makefile_var(builddir, name):
8989
regex = re.compile(rf'^{name} *=\s*(.*?)\s*$')
9090
filename = os.path.join(builddir, 'Makefile')
9191
try:
92-
infile = open(filename)
92+
infile = open(filename, encoding='utf-8')
9393
except FileNotFoundError:
9494
return None
9595
with infile:
@@ -125,7 +125,7 @@ def prepare(script=None, outdir=None):
125125
if script:
126126
scriptfile = os.path.join(outdir, 'app.py')
127127
print(f'creating the script to be frozen at {scriptfile}')
128-
with open(scriptfile, 'w') as outfile:
128+
with open(scriptfile, 'w', encoding='utf-8') as outfile:
129129
outfile.write(script)
130130

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

0 commit comments

Comments
 (0)