There was an error while loading. Please reload this page.
1 parent f20b504 commit fb558f1Copy full SHA for fb558f1
1 file changed
Lib/test/test_argparse.py
@@ -7345,6 +7345,9 @@ def test_module_as_main_without_altering_argv(self):
7345
basename = 'module' + os_helper.FS_NONASCII
7346
modulename = f'{self.dirname}.{basename}'
7347
self.make_script(self.dirname, basename)
7348
+ # The filesystem encoding may be non-UTF-8,
7349
+ # but the runner runs in UTF-8 mode
7350
+ modulename = os.fsencode(modulename).decode("utf-8", "surrogateescape")
7351
runner_source = textwrap.dedent(f'''\
7352
import runpy
7353
runpy._run_module_as_main({modulename!r}, alter_argv=False)
0 commit comments