From 88c359c7bb71a3dbc81440ec74e3d1685c65a3f2 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 10 Aug 2023 17:20:16 +0300 Subject: [PATCH] Fix(locale): Do not call `locale.getdefaultlocale()` under Python 3.11+ The call is deprecated. --- m_lib/defenc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/m_lib/defenc.py b/m_lib/defenc.py index 776b78d..22cd21b 100755 --- a/m_lib/defenc.py +++ b/m_lib/defenc.py @@ -15,7 +15,10 @@ __all__ = ['default_encoding'] if use_locale: # Get the default charset. try: - lcAll = locale.getdefaultlocale() + if sys.version_info[:2] < (3, 11): + lcAll = locale.getdefaultlocale() + else: + lcAll = [] except locale.Error as err: print("WARNING:", err, file=sys.stderr) lcAll = [] -- 2.39.5