You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test passes arbitrary bytes as argv and checks they round-trip via os.fsencode(sys.argv[1]). But that round-trip is only lossless for UTF-8 and single-byte encodings; in a stateful multibyte encoding like EUC-JP it isn't (and Py_DecodeLocale()'s C decoder diverges from the Python codec anyway), so the run_default and run_no_utf8_mode variants — which use the filesystem / locale encoding — fail.
Bug report
test.test_cmd_line.CmdLineTest.test_invalid_utf8_argfails in a non-UTF-8 multibyte locale such asja_JP.eucjp:The test passes arbitrary bytes as
argvand checks they round-trip viaos.fsencode(sys.argv[1]). But that round-trip is only lossless for UTF-8 and single-byte encodings; in a stateful multibyte encoding like EUC-JP it isn't (andPy_DecodeLocale()'s C decoder diverges from the Python codec anyway), so therun_defaultandrun_no_utf8_modevariants — which use the filesystem / locale encoding — fail.Linked PRs