FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-104783: locale.getencoding() fallback uses FS encoding by vstinner · Pull Request #105381 · python/cpython · GitHub

/ cpython Public

gh-104783: locale.getencoding() fallback uses FS encoding - #105381

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:fs_encoding
Jun 6, 2023
Merged

gh-104783: locale.getencoding() fallback uses FS encoding#105381
vstinner merged 1 commit into
python:mainfrom
vstinner:fs_encoding

Conversation

vstinner commented Jun 6, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

The locale.getencoding() function now uses
sys.getfilesystemencoding() if _locale.getencoding() is missing, instead of calling locale.getdefaultlocale().

The locale.getencoding() function now uses
sys.getfilesystemencoding() if _locale.getencoding() is missing,
instead of calling locale.getdefaultlocale().

vstinner commented Jun 6, 2023

Copy link
Copy Markdown
Member Author

@methane: This change is more a theorical change, since it doesn't affect CPython which always has the _locale extension. But it's needed to prepare the removal of the deprecated locale.getdefaultencoding() function.

vstinner commented Jun 6, 2023

Copy link
Copy Markdown
Member Author

I don't think that a Changelog entry is needed, since it doesn't affect CPython users.

vstinner merged commit b1a91d2 into python:main Jun 6, 2023
vstinner deleted the fs_encoding branch June 6, 2023 14:55
Comment thread Lib/locale.py
# LANG not set, default to UTF-8
encoding = 'utf-8'
return encoding
return _encoding

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

return sys.getfilesystemencoding() would be enough.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I created PR #105401 to change this.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL