gh-156713: Fix test_nturl2path for non-UTF-8 filesystem encodings - #157461
Conversation
Since nturl2path uses the filesystem encoding, the expected results of quoting non-ASCII characters depend on it. Use os_helper.FS_NONASCII and os_helper.TESTFN_UNDECODABLE, and skip the tests when there is no suitable character or byte sequence for the current encoding. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
|
GH-157462 is a backport of this pull request to the 3.14 branch. |
…encodings (pythonGH-157461) Use os_helper.FS_NONASCII and os_helper.TESTFN_UNDECODABLE instead of hardcoded UTF-8 results. (cherry picked from commit fd0970c) Co-authored-by: Serhiy Storchaka <[email protected]>
|
GH-157464 is a backport of this pull request to the 3.13 branch. |
…ngs (GH-157461) (GH-157462) Use os_helper.FS_NONASCII and os_helper.TESTFN_UNDECODABLE instead of hardcoded UTF-8 results. (cherry picked from commit fd0970c) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
|
|
…gs (pythonGH-157461) Use os_helper.FS_NONASCII and os_helper.TESTFN_UNDECODABLE instead of hardcoded UTF-8 results. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Since gh-156713,
nturl2pathuses the filesystem encoding, so the expected results of quoting non-ASCII characters depend on it. The tests failed on the ARM64 Raspbian buildbots, which run with a Latin-1 locale (#157424):'\xe9'is quoted as%E9there, and'\udcff'does not survive a round trip becauseb'\xff'is decodable.Use
os_helper.FS_NONASCIIandos_helper.TESTFN_UNDECODABLE, and skip the tests when there is no suitable character or byte sequence for the current encoding. Tested with UTF-8, ISO-8859-1/-3/-7/-9/-15, KOI8-R/-U, EUC-JP, GB2312, EUC-KR and ASCII filesystem encodings.3.13 has the tests in
test_urlliband needs a manual backport.