From: Oleg Broytman Date: Wed, 9 Aug 2023 18:14:21 +0000 (+0300) Subject: Fix(locale): Do not call `locale.getdefaultlocale()` under Python 3.11+ X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=60a2cad054e289df4e6d25e216350f3516661462;p=extfs.d.git Fix(locale): Do not call `locale.getdefaultlocale()` under Python 3.11+ The call is deprecated. --- diff --git a/torrent b/torrent index 550ad72..1a3c2c1 100755 --- a/torrent +++ b/torrent @@ -56,7 +56,10 @@ except ImportError: 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 = [] diff --git a/xml b/xml index d2beb55..59144c3 100755 --- a/xml +++ b/xml @@ -86,7 +86,10 @@ except ImportError: 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 = []