bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035)
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index d3191ed..ca003d5 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -80,8 +80,8 @@
def get_env_file(self, *args):
return os.path.join(self.env_dir, *args)
- def get_text_file_contents(self, *args):
- with open(self.get_env_file(*args), 'r') as f:
+ def get_text_file_contents(self, *args, encoding='utf-8'):
+ with open(self.get_env_file(*args), 'r', encoding=encoding) as f:
result = f.read()
return result