The upstream package uses `gettext.bind_textdomain_codeset` which is removed in Python 3.11 When trying to open the preference for `Chinese-Pinyin` in `ibus-setup`, an error is thrown: ``` Traceback (most recent call last): File "/usr/share/ibus-pinyin/setup/main.py", line 432, in <module> main() File "/usr/share/ibus-pinyin/setup/main.py", line 428, in main PreferencesDialog(name).run() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/ibus-pinyin/setup/main.py", line 48, in __init__ gettext.bind_textdomain_codeset("ibus-pinyin", "UTF-8") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset' ``` The relevant APIs were already removed in Python 3.10: https://bugs.python.org/issue40936 https://docs.python.org/3.10/library/gettext.html#gettext.bind_textdomain_codeset This is a UX issue but does prevent basic functionalities. Reproducible: Always
By removing this single line seems to fix the issue. The preference can now function properly ``` File "/usr/share/ibus-pinyin/setup/main.py", line 48, in __init__ gettext.bind_textdomain_codeset("ibus-pinyin", "UTF-8") ``` No further usages of removed API were found. An upstream PR has been open to attempt to fix this problem: https://github.com/ibus/ibus-pinyin/pull/13
> This is a UX issue but does prevent basic functionalities. Correction: does not prevent basic functionalities.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2ec315acbc673833f5e076c9e8f3b52b2826537 commit c2ec315acbc673833f5e076c9e8f3b52b2826537 Author: Yixun Lan <dlan@gentoo.org> AuthorDate: 2023-05-12 00:07:38 +0000 Commit: Yixun Lan <dlan@gentoo.org> CommitDate: 2023-05-12 00:11:06 +0000 app-i18n/ibus-pinyin: fix preference issue in ibus-setup Closes: https://bugs.gentoo.org/905906 Signed-off-by: Yixun Lan <dlan@gentoo.org> .../files/ibus-pinyin-1.5.0-gettext.patch | 16 ++++++ app-i18n/ibus-pinyin/ibus-pinyin-1.5.0-r6.ebuild | 64 ++++++++++++++++++++++ 2 files changed, 80 insertions(+)