summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_profile.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-04-04 00:01:23 (GMT)
committerGitHub <noreply@github.com>2021-04-04 00:01:23 (GMT)
commit35715d1e72b7e15e337087863c75af447199e0fb (patch)
tree2af3473ba410ffc4b83d74df4d0776814095f25d /Lib/test/test_profile.py
parentdc6d3e1e4c0c1e4b2210edab8fb4762569dc2936 (diff)
downloadcpython-35715d1e72b7e15e337087863c75af447199e0fb.zip
cpython-35715d1e72b7e15e337087863c75af447199e0fb.tar.gz
cpython-35715d1e72b7e15e337087863c75af447199e0fb.tar.bz2
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25145)
* test_asyncio * test_bz2 * test_math * test_cmath * test_cmd_line * test_cmd_line_script * test_compile * test_contextlib * test_profile * ctypes/test/test_find * test_multiprocessing * test_configparser * test_csv * test_dbm_dumb * test_decimal * test_difflib * os.fdopen() calls io.text_encoding() to emit EncodingWarning for right place.
Diffstat (limited to 'Lib/test/test_profile.py')
-rw-r--r--Lib/test/test_profile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_profile.py b/Lib/test/test_profile.py
index 1bdf30a..7de7d52 100644
--- a/Lib/test/test_profile.py
+++ b/Lib/test/test_profile.py
@@ -115,7 +115,7 @@ class ProfileTest(unittest.TestCase):
def test_output_file_when_changing_directory(self):
with temp_dir() as tmpdir, change_cwd(tmpdir):
os.mkdir('dest')
- with open('demo.py', 'w') as f:
+ with open('demo.py', 'w', encoding="utf-8") as f:
f.write('import os; os.chdir("dest")')
assert_python_ok(