Skip to content

Commit

Permalink
Remove call to deprecated bind_textdomain_codeset gettext function
Browse files Browse the repository at this point in the history
This function was deprecated and eventually removed in Python3.11
(see changelog at https://docs.python.org/3/whatsnew/3.11.html)

> Removed the deprecated gettext functions lgettext(), ldgettext(),
> lngettext() and ldngettext(). Also removed the bind_textdomain_codeset()
> function, the NullTranslations.output_charset() and
> NullTranslations.set_output_charset() methods, and the codeset parameter
> of translation() and install(), since they are only used for the
> l*gettext() functions. (Contributed by Dong-hee Na and Serhiy Storchaka
> in bpo-44235.)
  • Loading branch information
fgrosse committed Mar 21, 2023
1 parent 71076a5 commit b155ad5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/hamster/lib/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ def setup_i18n():
module.bindtextdomain('hamster', locale_dir)
module.textdomain('hamster')

module.bind_textdomain_codeset('hamster','utf8')

gettext.install("hamster", locale_dir)

else:
Expand Down

2 comments on commit b155ad5

@roomcays
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today's (2023.05.15) Arch Linux upgrade made Hamster don't start. Commenting this line out helped.
Looks like this patch should be implemented wrapped in condition of detection of Python runtime version.

@matthijskooijman
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this patch should be implemented wrapped in condition of detection of Python runtime version.

Should it? In the PR about this, I think we decided to drop the line entirely, because it has no function in python3 at all (and we do not supported python2 anymore). It's just that this is fixed in git master, but not included in a release yet (working on that...).

Please sign in to comment.