mirror of
https://github.com/python/cpython
synced 2024-10-14 10:48:24 +00:00
gh-111187: Postpone removal version for locale.getdefaultlocale() to 3.15 (#111188)
This commit is contained in:
parent
f6304949bb
commit
81ed80d843
|
@ -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
|
*language code* and *encoding* may be ``None`` if their values cannot be
|
||||||
determined.
|
determined.
|
||||||
|
|
||||||
.. deprecated-removed:: 3.11 3.13
|
.. deprecated-removed:: 3.11 3.15
|
||||||
|
|
||||||
|
|
||||||
.. function:: getlocale(category=LC_CTYPE)
|
.. function:: getlocale(category=LC_CTYPE)
|
||||||
|
|
|
@ -1798,7 +1798,7 @@ Standard Library
|
||||||
* :func:`importlib.resources.path`
|
* :func:`importlib.resources.path`
|
||||||
|
|
||||||
* The :func:`locale.getdefaultlocale` function is deprecated and will be
|
* 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.getpreferredencoding(False) <locale.getpreferredencoding>` and
|
||||||
:func:`locale.getlocale` functions instead.
|
:func:`locale.getlocale` functions instead.
|
||||||
(Contributed by Victor Stinner in :gh:`90817`.)
|
(Contributed by Victor Stinner in :gh:`90817`.)
|
||||||
|
|
|
@ -1360,7 +1360,6 @@ Other modules:
|
||||||
APIs:
|
APIs:
|
||||||
|
|
||||||
* :class:`!configparser.LegacyInterpolation` (:gh:`90765`)
|
* :class:`!configparser.LegacyInterpolation` (:gh:`90765`)
|
||||||
* :func:`locale.getdefaultlocale` (:gh:`90817`)
|
|
||||||
* ``locale.resetlocale()`` (:gh:`90817`)
|
* ``locale.resetlocale()`` (:gh:`90817`)
|
||||||
* :meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)
|
* :meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)
|
||||||
* :func:`!unittest.findTestCases` (:gh:`50096`)
|
* :func:`!unittest.findTestCases` (:gh:`50096`)
|
||||||
|
@ -1430,6 +1429,17 @@ and will be removed in Python 3.14.
|
||||||
|
|
||||||
* The ``co_lnotab`` attribute of code objects.
|
* The ``co_lnotab`` attribute of code objects.
|
||||||
|
|
||||||
|
Pending Removal in Python 3.15
|
||||||
|
------------------------------
|
||||||
|
|
||||||
|
The following APIs have been deprecated
|
||||||
|
and will be removed in Python 3.15.
|
||||||
|
|
||||||
|
APIs:
|
||||||
|
|
||||||
|
* :func:`locale.getdefaultlocale` (:gh:`90817`)
|
||||||
|
|
||||||
|
|
||||||
Pending Removal in Future Versions
|
Pending Removal in Future Versions
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
|
|
|
@ -500,6 +500,13 @@ Pending Removal in Python 3.15
|
||||||
rarely used. No direct replacement exists. *Anything* is better than CGI
|
rarely used. No direct replacement exists. *Anything* is better than CGI
|
||||||
to interface a web server with a request handler.
|
to interface a web server with a request handler.
|
||||||
|
|
||||||
|
* :class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python 3.11
|
||||||
|
and originally planned for removal in Python 3.13 (:gh:`90817`),
|
||||||
|
but removal has been postponed to Python 3.15.
|
||||||
|
Use :func:`locale.setlocale()`, :func:`locale.getencoding()` and
|
||||||
|
:func:`locale.getlocale()` instead.
|
||||||
|
(Contributed by Hugo van Kemenade in :gh:`111187`.)
|
||||||
|
|
||||||
* :class:`typing.NamedTuple`:
|
* :class:`typing.NamedTuple`:
|
||||||
|
|
||||||
* The undocumented keyword argument syntax for creating NamedTuple classes
|
* The undocumented keyword argument syntax for creating NamedTuple classes
|
||||||
|
@ -612,10 +619,6 @@ although there is currently no date scheduled for their removal.
|
||||||
<https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy>`_
|
<https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy>`_
|
||||||
for migration advice.
|
for migration advice.
|
||||||
|
|
||||||
* :func:`locale.getdefaultlocale`: use :func:`locale.setlocale()`,
|
|
||||||
:func:`locale.getencoding()` and :func:`locale.getlocale()` instead
|
|
||||||
(:gh:`90817`)
|
|
||||||
|
|
||||||
* :mod:`mailbox`: Use of StringIO input and text mode is deprecated, use
|
* :mod:`mailbox`: Use of StringIO input and text mode is deprecated, use
|
||||||
BytesIO and binary mode instead.
|
BytesIO and binary mode instead.
|
||||||
|
|
||||||
|
|
|
@ -541,12 +541,14 @@ def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import warnings
|
import warnings
|
||||||
warnings.warn(
|
warnings._deprecated(
|
||||||
"Use setlocale(), getencoding() and getlocale() instead",
|
"locale.getdefaultlocale",
|
||||||
DeprecationWarning, stacklevel=2
|
"{name!r} is deprecated and slated for removal in Python {remove}. "
|
||||||
)
|
"Use setlocale(), getencoding() and getlocale() instead.",
|
||||||
|
remove=(3, 15))
|
||||||
return _getdefaultlocale(envvars)
|
return _getdefaultlocale(envvars)
|
||||||
|
|
||||||
|
|
||||||
def _getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
|
def _getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
|
||||||
try:
|
try:
|
||||||
# check if it's supported by the _locale module
|
# check if it's supported by the _locale module
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Postpone removal version for locale.getdefaultlocale() to Python 3.15.
|
Loading…
Reference in a new issue