Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-46659: Deprecate locale.getdefaultlocale()#31206

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

Merged
vstinner merged 1 commit intopython:mainfromvstinner:deprecate_getdefaultlocale
Feb 22, 2022
Merged

bpo-46659: Deprecate locale.getdefaultlocale()#31206

vstinner merged 1 commit intopython:mainfromvstinner:deprecate_getdefaultlocale
Feb 22, 2022

Conversation

vstinner
Copy link
Member

@vstinnervstinner commentedFeb 7, 2022
edited
Loading

The locale.getdefaultlocale() function is deprecated and will be removed in
Python 3.13. Use locale.setlocale(),
locale.getpreferredencoding(False) and locale.getlocale() functions
instead.

https://bugs.python.org/issue46659

@vstinnervstinner changed the titlebpo-43557: Deprecate locale.getdefaultlocale()bpo-46659: Deprecate locale.getdefaultlocale()Feb 8, 2022
@vstinner
Copy link
MemberAuthor

cc@malemburg

The locale.getdefaultlocale() function is deprecated and will beremoved in Python 3.13. Use locale.setlocale(),locale.getpreferredencoding(False) and locale.getlocale() functionsinstead.
@vstinner
Copy link
MemberAuthor

@methane
Copy link
Member

Locale is too difficult to me, so I can not say LGTM.
At least, I feel it is very tempting API that can be used to get preferred language without calling setlocale()...

@vstinner
Copy link
MemberAuthor

vstinner commentedFeb 11, 2022
edited
Loading

At least, I feel it is very tempting API that can be used to get preferred language without calling setlocale()...

The function is convenient until you fall into a case where it doesn't work as expected. It's similar to mixing Python 2 str and unicode types. It works in most cases, until someone enters a name with a single non-ASCII character, and then suddently everything fall apart.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@vstinner@methane@the-knights-who-say-ni@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp