diff options
author | somov <somov@yandex-team.com> | 2023-05-18 17:01:07 +0300 |
---|---|---|
committer | somov <somov@yandex-team.com> | 2023-05-18 17:01:07 +0300 |
commit | 61480ac2bbf60b1cd0923b45601c210fce3f27cd (patch) | |
tree | aa3834ce0c978c1f2b37f3d10d84432da193bcb1 /library | |
parent | 609d4c8138a6605de6fbc333e865b36acdb5cee6 (diff) | |
download | ydb-61480ac2bbf60b1cd0923b45601c210fce3f27cd.tar.gz |
Fix some deprecation warnings
Diffstat (limited to 'library')
-rw-r--r-- | library/python/strings/strings.py | 5 |
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 |