File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -375,6 +375,8 @@ The :mod:`locale` module defines the following exception and functions:
375
375
The default setting is determined by calling :func: `getdefaultlocale `.
376
376
*category * defaults to :const: `LC_ALL `.
377
377
378
+ .. deprecated :: 3.11 3.13
379
+
378
380
379
381
.. function :: strcoll(string1, string2)
380
382
Original file line number Diff line number Diff line change @@ -1221,7 +1221,11 @@ Deprecated
1221
1221
removed in Python 3.13. Use :func: `locale.setlocale `,
1222
1222
:func: `locale.getpreferredencoding(False) <locale.getpreferredencoding> ` and
1223
1223
:func: `locale.getlocale ` functions instead.
1224
- (Contributed by Victor Stinner in :issue: `46659 `.)
1224
+ (Contributed by Victor Stinner in :gh: `90817 `.)
1225
+
1226
+ * The :func: `locale.resetlocale ` function is deprecated and will be
1227
+ removed in Python 3.13. Use ``locale.setlocale(locale.LC_ALL, "") `` instead.
1228
+ (Contributed by Victor Stinner in :gh: `90817 `.)
1225
1229
1226
1230
* The :mod: `asynchat `, :mod: `asyncore ` and :mod: `smtpd ` modules have been
1227
1231
deprecated since at least Python 3.6. Their documentation and deprecation
Original file line number Diff line number Diff line change @@ -633,7 +633,17 @@ def resetlocale(category=LC_ALL):
633
633
getdefaultlocale(). category defaults to LC_ALL.
634
634
635
635
"""
636
- _setlocale (category , _build_localename (getdefaultlocale ()))
636
+ import warnings
637
+ warnings .warn (
638
+ 'Use locale.setlocale(locale.LC_ALL, "") instead' ,
639
+ DeprecationWarning , stacklevel = 2
640
+ )
641
+
642
+ with warnings .catch_warnings ():
643
+ warnings .simplefilter ('ignore' , category = DeprecationWarning )
644
+ loc = getdefaultlocale ()
645
+
646
+ _setlocale (category , _build_localename (loc ))
637
647
638
648
639
649
try :
Original file line number Diff line number Diff line change
1
+ The :func: `locale.resetlocale ` function is deprecated and will be removed in
2
+ Python 3.13. Use ``locale.setlocale(locale.LC_ALL, "") `` instead. Patch by
3
+ Victor Stinner.
You can’t perform that action at this time.
0 commit comments