gh-99437: runpy: decode path-like objects before setting globals

This commit is contained in:
Kamil Turek 2024-01-15 17:58:50 +01:00 committed by GitHub
parent 3eae76554b
commit d457345bbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 9 deletions

View file

@ -661,8 +661,10 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
mod_name = 'script'
script_name = pathlib.Path(self._make_test_script(script_dir,
mod_name))
self._check_script(script_name, "<run_path>", script_name,
script_name, expect_spec=False)
self._check_script(script_name, "<run_path>",
os.fsdecode(script_name),
os.fsdecode(script_name),
expect_spec=False)
def test_basic_script_no_suffix(self):
with temp_dir() as script_dir: