summaryrefslogtreecommitdiffstats
path: root/Tools/freeze
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-11-30 04:16:40 (GMT)
committerGitHub <noreply@github.com>2021-11-30 04:16:40 (GMT)
commit9a5dec4e978f68ab956e979858ce3aa178436fa4 (patch)
tree6a40d2cd15a39203c8395b7fee750222d8800e3a /Tools/freeze
parentbd9342dddead5993500e7978edad7b5e6a0c1f26 (diff)
downloadcpython-9a5dec4e978f68ab956e979858ce3aa178436fa4.zip
cpython-9a5dec4e978f68ab956e979858ce3aa178436fa4.tar.gz
cpython-9a5dec4e978f68ab956e979858ce3aa178436fa4.tar.bz2
Fix EncodingWarning in Tools/freeze/test/freeze.py (GH-29742)
Diffstat (limited to 'Tools/freeze')
-rw-r--r--Tools/freeze/test/freeze.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/freeze/test/freeze.py b/Tools/freeze/test/freeze.py
index db2aa31..abedac0 100644
--- a/Tools/freeze/test/freeze.py
+++ b/Tools/freeze/test/freeze.py
@@ -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:
@@ -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