Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-104783: locale.getencoding() fallback uses FS encoding#105381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The locale.getencoding() function now usessys.getfilesystemencoding() if _locale.getencoding() is missing,instead of calling locale.getdefaultlocale().
@methane: This change is more a theorical change, since it doesn't affect CPython which always has the |
I don't think that a Changelog entry is needed, since it doesn't affect CPython users. |
# LANG not set, default to UTF-8 | ||
encoding = 'utf-8' | ||
return encoding | ||
return _encoding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
return sys.getfilesystemencoding()
would be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I created PR#105401 to change this.
Uh oh!
There was an error while loading.Please reload this page.
The locale.getencoding() function now uses
sys.getfilesystemencoding() if _locale.getencoding() is missing, instead of calling locale.getdefaultlocale().