The default setting is determined by calling :func:`getdefaultlocale`.
*category* defaults to :const:`LC_ALL`.
+ .. deprecated:: 3.11 3.13
+
.. function:: strcoll(string1, string2)
removed in Python 3.13. Use :func:`locale.setlocale`,
:func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>` and
:func:`locale.getlocale` functions instead.
- (Contributed by Victor Stinner in :issue:`46659`.)
+ (Contributed by Victor Stinner in :gh:`90817`.)
+
+* The :func:`locale.resetlocale` function is deprecated and will be
+ removed in Python 3.13. Use ``locale.setlocale(locale.LC_ALL, "")`` instead.
+ (Contributed by Victor Stinner in :gh:`90817`.)
* The :mod:`asynchat`, :mod:`asyncore` and :mod:`smtpd` modules have been
deprecated since at least Python 3.6. Their documentation and deprecation
getdefaultlocale(). category defaults to LC_ALL.
"""
- _setlocale(category, _build_localename(getdefaultlocale()))
+ import warnings
+ warnings.warn(
+ 'Use locale.setlocale(locale.LC_ALL, "") instead',
+ DeprecationWarning, stacklevel=2
+ )
+
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ loc = getdefaultlocale()
+
+ _setlocale(category, _build_localename(loc))
try:
--- /dev/null
+The :func:`locale.resetlocale` function is deprecated and will be removed in
+Python 3.13. Use ``locale.setlocale(locale.LC_ALL, "")`` instead. Patch by
+Victor Stinner.