8000 [3.11] gh-111187: Postpone removal version for locale.getdefaultlocal… · python/cpython@e7cdccc · GitHub
[go: up one dir, main page]

Skip to content

Commit e7cdccc

Browse files
authored
[3.11] gh-111187: Postpone removal version for locale.getdefaultlocale() to 3.15 (GH-111188) (#111326)
1 parent 22cde39 commit e7cdccc

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
30730 10000 7

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
import warnings
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)
0