Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Jun 6, 2023

locale.getlocale() always calls sys.getfilesystemencoding(), instead of calling it only once.

locale.getlocale() always calls sys.getfilesystemencoding(), instead
of calling it only once.
@vstinner
Copy link
Member Author

vstinner commented Jun 6, 2023

@methane: I added _encoding variable to be able to calle locale.getencoding() during Python finalization, when modules attributes are set to None. But maybe it's not needed. By the way, Python tries to keep sys attributes as long as posible. So I wrote this PR to change it :-)

@vstinner vstinner enabled auto-merge (squash) June 6, 2023 18:07
@vstinner vstinner merged commit 221d703 into python:main Jun 6, 2023
@vstinner vstinner deleted the locale_getencoding_call branch June 14, 2023 15:38
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