Skip to content

Commit 0fcea6c

Browse files
author
Sylvain MARIE
committed
Fixed tm.set_locale context manager, it could error and leak when category LC_ALL was used. Fixed pandas-dev#46595
1 parent a1f3773 commit 0fcea6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/_config/localization.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def set_locale(
3939
particular locale, without globally setting the locale. This probably isn't
4040
thread-safe.
4141
"""
42-
current_locale = locale.getlocale()
42+
# getlocale is wrong, see GH#46595
43+
current_locale = locale.setlocale(lc_var)
4344

4445
try:
4546
locale.setlocale(lc_var, new_locale)

0 commit comments

Comments
 (0)