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

Commite7cdccc

Browse files
authored
[3.11]gh-111187: Postpone removal version for locale.getdefaultlocale() to 3.15 (GH-111188) (#111326)
1 parent22cde39 commite7cdccc

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

‎Doc/library/locale.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ The :mod:`locale` module defines the following exception and functions:
303303
*language code* and *encoding* may be ``None`` if their values cannot be
304304
determined.
305305

306-
..deprecated-removed::3.11 3.13
306+
..deprecated-removed::3.11 3.15
307307

308308

309309
..function::getlocale(category=LC_CTYPE)

‎Doc/whatsnew/3.11.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ Standard Library
17981798
*:func:`importlib.resources.path`
17991799

18001800
* The:func:`locale.getdefaultlocale` function is deprecated and will be
1801-
removed in Python 3.13. Use:func:`locale.setlocale`,
1801+
removed in Python 3.15. Use:func:`locale.setlocale`,
18021802
:func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>` and
18031803
:func:`locale.getlocale` functions instead.
18041804
(Contributed by Victor Stinner in:gh:`90817`.)

‎Lib/locale.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,11 @@ def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
556556
"""
557557

558558
importwarnings
559-
warnings.warn(
560-
"Use setlocale(), getencoding() and getlocale() instead",
561-
DeprecationWarning,stacklevel=2
562-
)
559+
warnings._deprecated(
560+
"locale.getdefaultlocale",
561+
"{name!r} is deprecated and slated for removal in Python {remove}. "
562+
"Use setlocale(), getencoding() and getlocale() instead.",
563+
remove=(3,15))
563564

564565
try:
565566
# check if it's supported by the _locale module
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Postpone removal version for locale.getdefaultlocale() to Python 3.15.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp