Skip to content

Conversation

StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Sep 29, 2025

Note that on main UTF-8 mode is now default so this is only an issue if disabled.

text=True)
self.assertEqual(cmd.stdout.rstrip(), loc)

def test_unsupported_locale_fallback_to_utf8(self):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not quite sure where to put this test.

@methane
Copy link
Member

methane commented Sep 30, 2025

I'm not sure it's a good idea to automatically modify the stdio encoding. If the locale encoding isn't available, how much likelihood is there that the application will function properly after Python starts? Wouldn't it be better to also produce an error if the user has set an incorrect PYTHONIOENCODING?

@serhiy-storchaka
Copy link
Member

If the user disabled UTF-8 mode, I think that it is incorrect to ignore this. Error is more preferable to producing mojibake.

@StanFromIreland
Copy link
Member Author

Ok, so I propose throwing a more informative error then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants