mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[3.11] gh-111187: Postpone removal version for locale.getdefaultlocale() to 3.15 (GH-111188) (#111326)
This commit is contained in:
parent
22cde39fbf
commit
e7cdcccd26
4 changed files with 8 additions and 6 deletions
|
|
@ -303,7 +303,7 @@ The :mod:`locale` module defines the following exception and functions:
|
|||
*language code* and *encoding* may be ``None`` if their values cannot be
|
||||
determined.
|
||||
|
||||
.. deprecated-removed:: 3.11 3.13
|
||||
.. deprecated-removed:: 3.11 3.15
|
||||
|
||||
|
||||
.. function:: getlocale(category=LC_CTYPE)
|
||||
|
|
|
|||
|
|
@ -1798,7 +1798,7 @@ Standard Library
|
|||
* :func:`importlib.resources.path`
|
||||
|
||||
* The :func:`locale.getdefaultlocale` function is deprecated and will be
|
||||
removed in Python 3.13. Use :func:`locale.setlocale`,
|
||||
removed in Python 3.15. Use :func:`locale.setlocale`,
|
||||
:func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>` and
|
||||
:func:`locale.getlocale` functions instead.
|
||||
(Contributed by Victor Stinner in :gh:`90817`.)
|
||||
|
|
|
|||
|
|
@ -556,10 +556,11 @@ def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
|
|||
"""
|
||||
|
||||
import warnings
|
||||
warnings.warn(
|
||||
"Use setlocale(), getencoding() and getlocale() instead",
|
||||
DeprecationWarning, stacklevel=2
|
||||
)
|
||||
warnings._deprecated(
|
||||
"locale.getdefaultlocale",
|
||||
"{name!r} is deprecated and slated for removal in Python {remove}. "
|
||||
"Use setlocale(), getencoding() and getlocale() instead.",
|
||||
remove=(3, 15))
|
||||
|
||||
try:
|
||||
# check if it's supported by the _locale module
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Postpone removal version for locale.getdefaultlocale() to Python 3.15.
|
||||
Loading…
Add table
Add a link
Reference in a new issue