* ``load_module()`` method: use ``exec_module()`` instead.
-* :class:`locale`:
-
- * The :func:`~locale.getdefaultlocale` function
- has been deprecated since Python 3.11.
- Its removal was originally planned for Python 3.13 (:gh:`90817`),
- but has been postponed to Python 3.15.
- Use :func:`~locale.getlocale`, :func:`~locale.setlocale`,
- and :func:`~locale.getencoding` instead.
- (Contributed by Hugo van Kemenade in :gh:`111187`.)
-
* :mod:`pathlib`:
* :meth:`.PurePath.is_reserved`
determined.
The "C" locale is represented as ``(None, None)``.
- .. deprecated-removed:: 3.11 3.15
-
.. function:: getlocale(category=LC_CTYPE)
"""
- import warnings
- 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)
from decimal import Decimal
from test.support import verbose, is_android, is_emscripten, is_wasi
-from test.support.warnings_helper import check_warnings
from test.support.import_helper import import_fresh_module
from unittest import mock
import unittest
os.environ['LC_CTYPE'] = 'UTF-8'
- with check_warnings(('', DeprecationWarning)):
- self.assertEqual(locale.getdefaultlocale(), (None, 'UTF-8'))
+ self.assertEqual(locale.getdefaultlocale(), (None, 'UTF-8'))
finally:
for k in orig_env:
--- /dev/null
+Undeprecate the :func:`locale.getdefaultlocale` function.
+Patch by Victor Stinner.