aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/strings/strings.py
diff options
context:
space:
mode:
Diffstat (limited to 'library/python/strings/strings.py')
-rw-r--r--library/python/strings/strings.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/python/strings/strings.py b/library/python/strings/strings.py
index 41957ab40b..4a256bf4c3 100644
--- a/library/python/strings/strings.py
+++ b/library/python/strings/strings.py
@@ -100,7 +100,10 @@ def stringize_deep(x, enc=DEFAULT_ENCODING, relaxed=True):
@library.python.func.memoize()
def locale_encoding():
try:
- loc = locale.getdefaultlocale()[1]
+ if six.PY3:
+ loc = locale.getencoding()
+ else:
+ loc = locale.getdefaultlocale()[1]
if loc:
codecs.lookup(loc)
return loc