summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-10-10 07:14:40 (GMT)
committerGitHub <noreply@github.com>2021-10-10 07:14:40 (GMT)
commita1c3c9e8245a88cf37b084869b3559638116daf7 (patch)
tree506e40dc912bcfc8113230cad6b064c0fd1b3520 /Tools
parent3d1ca867ed0e3ae343166806f8ddd9739e568ab4 (diff)
downloadcpython-a1c3c9e8245a88cf37b084869b3559638116daf7.zip
cpython-a1c3c9e8245a88cf37b084869b3559638116daf7.tar.gz
cpython-a1c3c9e8245a88cf37b084869b3559638116daf7.tar.bz2
Fix EncodingWarning in test_tools. (GH-28846)
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/gprof2html.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/scripts/gprof2html.py b/Tools/scripts/gprof2html.py
index b14def4..bf0530e 100755
--- a/Tools/scripts/gprof2html.py
+++ b/Tools/scripts/gprof2html.py
@@ -24,7 +24,7 @@ trailer = """\
"""
def add_escapes(filename):
- with open(filename) as fp:
+ with open(filename, encoding="utf-8") as fp:
for line in fp:
yield html.escape(line)
@@ -79,7 +79,7 @@ def main():
filename = sys.argv[1]
outputfilename = filename + ".html"
input = add_escapes(filename)
- with open(outputfilename, "w") as output:
+ with open(outputfilename, "w", encoding="utf-8") as output:
gprof2html(input, output, filename)
webbrowser.open("file:" + os.path.abspath(outputfilename))