*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)
* :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`.)
APIs:
* :class:`!configparser.LegacyInterpolation` (:gh:`90765`)
-* :func:`locale.getdefaultlocale` (:gh:`90817`)
+* ``locale.resetlocale()`` (:gh:`90817`)
* :meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)
* :func:`!unittest.findTestCases` (:gh:`50096`)
* :func:`!unittest.getTestCaseNames` (:gh:`50096`)
* 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
----------------------------------
"""
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))
return _getdefaultlocale(envvars)
+
def _getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
try:
# check if it's supported by the _locale module
--- /dev/null
+Postpone removal version for locale.getdefaultlocale() to Python 3.15.