Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 221d703

Browse files
authoredJun 6, 2023
pythongh-104783: locale.getlocale() calls sys.getfilesystemencoding() (python#105401)
locale.getlocale() always calls sys.getfilesystemencoding(), instead of calling it only once.
1 parent 2b8e6e5 commit 221d703

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎Lib/locale.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,8 @@ def setlocale(category, locale=None):
618618
except ImportError:
619619
# When _locale.getencoding() is missing, locale.getencoding() uses the
620620
# Python filesystem encoding.
621-
_encoding = sys.getfilesystemencoding()
622621
def getencoding():
623-
return _encoding
622+
return sys.getfilesystemencoding()
624623

625624

626625
try:

0 commit comments

Comments
 (0)
Please sign in to comment.