mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-41069: Make TESTFN and the CWD for tests containing non-ascii characters. (GH-21035)
This commit is contained in:
parent
8ea6353f60
commit
700cfa8c90
24 changed files with 110 additions and 77 deletions
|
@ -80,8 +80,8 @@ class BaseTest(unittest.TestCase):
|
|||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue