summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-06-06 18:19:40 (GMT)
committerGitHub <noreply@github.com>2023-06-06 18:19:40 (GMT)
commit221d703498d84e363070c89c28f839edceaac9b2 (patch)
tree4b2ad0424899640925bee0bf943d09117d575d4b
parent2b8e6e5712a83657333948bc387c81db02549b13 (diff)
downloadcpython-221d703498d84e363070c89c28f839edceaac9b2.zip
cpython-221d703498d84e363070c89c28f839edceaac9b2.tar.gz
cpython-221d703498d84e363070c89c28f839edceaac9b2.tar.bz2
gh-104783: locale.getlocale() calls sys.getfilesystemencoding() (#105401)
locale.getlocale() always calls sys.getfilesystemencoding(), instead of calling it only once.
-rw-r--r--Lib/locale.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/locale.py b/Lib/locale.py
index cd52ecd..55c819c 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -618,9 +618,8 @@ try:
except ImportError:
# When _locale.getencoding() is missing, locale.getencoding() uses the
# Python filesystem encoding.
- _encoding = sys.getfilesystemencoding()
def getencoding():
- return _encoding
+ return sys.getfilesystemencoding()
try: