*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`.)
"""
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
--- /dev/null
+Postpone removal version for locale.getdefaultlocale() to Python 3.15.