gh-155009: Fix argparse test on non-UTF-8 locales like Raspbian - #155227
gh-155009: Fix argparse test on non-UTF-8 locales like Raspbian#155227hugovk wants to merge 1 commit into
Conversation
|
!buildbot ARM64 Raspbian |
|
🤖 New build scheduled with the buildbot fleet by @hugovk for commit be68e22 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F155227%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
| self.make_script(self.dirname, basename) | ||
| # The filesystem encoding may be non-UTF-8, | ||
| # but the runner runs in UTF-8 mode | ||
| modulename = os.fsencode(modulename).decode("utf-8", "surrogateescape") |
There was a problem hiding this comment.
Does it run in UTF-8 mode? Should this be locale.getpreferredencoding(), to handle PYTHONUTF8=0 ?
But it's in test-only code, so this shouldn't block the release.
There was a problem hiding this comment.
I think Hugo’s fix is sufficient here. check_usage() explicitly launches the child with -Xutf8, and -X utf8 takes precedence over PYTHONUTF8=0.
savannahostrowski
left a comment
There was a problem hiding this comment.
Thanks for this, Hugo!
Fix for #155199 (comment)
argparsereportspython -mfor programmatic module-as-main execution #155009