From c02b4836dd1798ab02f7701f8ee3f75731eb471f Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 25 May 2022 10:59:12 +0200 Subject: [PATCH] extensions: remove call to gettext.bind_textdomain_codeset(). I added this call originally, mimicking the C plug-ins. Yet in Python, this function is deprecated since Python 3.8 and removed in 3.10. Looking closer in the docs, it looks like Python's gettext module works differently. While all the *gettext() functions return strings in the locale's encoding in C, unless overriden by bind_textdomain_codeset() (therefore we need this call, in order to have locale-independent string encoding), this is not the case in Python, whose gettext() call is already locale-independent. The gettext.bind_textdomain_codeset() function only applies to the specific l*gettext() functions which are deprecated too. Fixes the warning: > goat-exercise-py3.py:37: DeprecationWarning: bind_textdomain_codeset() is deprecated --- extensions/goat-exercises/goat-exercise-py3.py | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/goat-exercises/goat-exercise-py3.py b/extensions/goat-exercises/goat-exercise-py3.py index 7b526920a5..da7c7e58b1 100755 --- a/extensions/goat-exercises/goat-exercise-py3.py +++ b/extensions/goat-exercises/goat-exercise-py3.py @@ -34,7 +34,6 @@ import sys # whereas the below calls are used for localization within the plug-in. textdomain = 'gimp30-std-plug-ins' gettext.bindtextdomain(textdomain, Gimp.locale_directory()) -gettext.bind_textdomain_codeset(textdomain, 'UTF-8') gettext.textdomain(textdomain) _ = gettext.gettext def N_(message): return message