There was an error while loading. Please reload this page.
1 parent 162bd7e commit 10509c3Copy full SHA for 10509c3
1 file changed
Lib/test/test_argparse.py
@@ -7132,6 +7132,9 @@ def test_module_as_main_without_altering_argv(self):
7132
basename = 'module' + os_helper.FS_NONASCII
7133
modulename = f'{self.dirname}.{basename}'
7134
self.make_script(self.dirname, basename)
7135
+ # The filesystem encoding may be non-UTF-8,
7136
+ # but the runner runs in UTF-8 mode
7137
+ modulename = os.fsencode(modulename).decode("utf-8", "surrogateescape")
7138
runner_source = textwrap.dedent(f'''\
7139
import runpy
7140
runpy._run_module_as_main({modulename!r}, alter_argv=False)
0 commit comments