deluge-gtk crashes on startup with AttributeError

Bug #2018159 reported by woodfighter
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
deluge (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The problem started after the upgrade to lunar.

Output on console is:

Unable to initialize gettext/locale!
module 'gettext' has no attribute 'bind_textdomain_codeset'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 111, in setup_translation
    gettext.bind_textdomain_codeset(I18N_DOMAIN, 'UTF-8')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset'
20:13:16 [ERROR ][deluge.i18n.util :146 ] Unable to initialize gettext/locale!
20:13:16 [ERROR ][deluge.i18n.util :147 ] module 'gettext' has no attribute 'bind_textdomain_codeset'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 111, in setup_translation
    gettext.bind_textdomain_codeset(I18N_DOMAIN, 'UTF-8')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset'
20:13:16 [ERROR ][deluge.i18n.util :146 ] Unable to initialize gettext/locale!
20:13:16 [ERROR ][deluge.i18n.util :147 ] module 'gettext' has no attribute 'bind_textdomain_codeset'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 111, in setup_translation
    gettext.bind_textdomain_codeset(I18N_DOMAIN, 'UTF-8')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset'
**
GLib-GObject:ERROR:../../../gobject/gobject.c:3616:toggle_refs_notify: assertion failed: (tstack.n_toggle_refs == 1)
Bail out! GLib-GObject:ERROR:../../../gobject/gobject.c:3616:toggle_refs_notify: assertion failed: (tstack.n_toggle_refs == 1)
Aborted (core dumped)

ProblemType: Bug
DistroRelease: Ubuntu 23.04
Package: deluge-gtk 2.0.3-4
ProcVersionSignature: Ubuntu 6.2.0-20.20-generic 6.2.6
Uname: Linux 6.2.0-20-generic x86_64
NonfreeKernelModules: wl nvidia_modeset nvidia
ApportVersion: 2.26.1-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: XFCE
Date: Sat Apr 29 20:22:06 2023
InstallationDate: Installed on 2020-01-20 (1194 days ago)
InstallationMedia: Xubuntu 20.04 LTS "Focal Fossa" - Alpha amd64 (20200118)
PackageArchitecture: all
SourcePackage: deluge
UpgradeStatus: Upgraded to lunar on 2023-04-29 (0 days ago)

Revision history for this message
woodfighter (woodfighter) wrote :
Revision history for this message
Ricardo Amendoeira (ric2b) wrote (last edit ):

I was able to get past this error by editing /usr/lib/python3/dist-packages/deluge/i18n/util.py:111 to change `gettext.bind_textdomain_codeset(I18N_DOMAIN, 'UTF-8')` to wrap it with a try/except of AttributeError that passes if the error is thrown, but then it still fails to start with the following error:

```
**
GLib-GObject:ERROR:../../../gobject/gobject.c:3616:toggle_refs_notify: assertion failed: (tstack.n_toggle_refs == 1)
Bail out! GLib-GObject:ERROR:../../../gobject/gobject.c:3616:toggle_refs_notify: assertion failed: (tstack.n_toggle_refs == 1)
'deluge' terminated by signal SIGABRT (Abort)
```

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in deluge (Ubuntu):
status: New → Confirmed
Revision history for this message
Matt Culler (mrculler) wrote :

I found this ticket because I encountered the same error on Debian Bookworm, and google only lead me here. The solution is for package maintainers to bump the deluge version from 2.0.3 to 2.0.4. If you check deluge/i18n/util.py:111, between those versions this line changes, because the gettext.bind_textdomain_codeset function was removed starting with python 3.10. (https://docs.python.org/3.8/library/gettext.html#gettext.bind_textdomain_codeset)

Revision history for this message
Aslan Gencer (aslan-gencer) wrote :

deluge-gtk works fine for me. I get this error when I use deluge-console application. It throws the error but continues and completes the command it was given.

`~$ /usr/bin/deluge-console -V
Unable to initialize gettext/locale!
module 'gettext' has no attribute 'bind_textdomain_codeset'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 111, in setup_translation
    gettext.bind_textdomain_codeset(I18N_DOMAIN, 'UTF-8')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset'
deluge-console 2.0.3
libtorrent: 2.0.8.0
Python: 3.11.2
OS: Linux Ubuntu 23.04 Lunar Lobster
`

Revision history for this message
Thomas Debesse (illwieckz) wrote :

Did you make something specific to get `deluge-gtk` working?

On my end I still get today (with deluge 2.0.3-4) the same error:

```
$ deluge-gtk
Unable to initialize gettext/locale!
module 'gettext' has no attribute 'bind_textdomain_codeset'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 111, in setup_translation
    gettext.bind_textdomain_codeset(I18N_DOMAIN, 'UTF-8')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset'
02:44:29 [ERROR ][deluge.i18n.util :146 ] Unable to initialize gettext/locale!
02:44:29 [ERROR ][deluge.i18n.util :147 ] module 'gettext' has no attribute 'bind_textdomain_codeset'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/i18n/util.py", line 111, in setup_translation
    gettext.bind_textdomain_codeset(I18N_DOMAIN, 'UTF-8')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gettext' has no attribute 'bind_textdomain_codeset'
**
GLib-GObject:ERROR:../../../gobject/gobject.c:3616:toggle_refs_notify: assertion failed: (tstack.n_toggle_refs == 1)
Bail out! GLib-GObject:ERROR:../../../gobject/gobject.c:3616:toggle_refs_notify: assertion failed: (tstack.n_toggle_refs == 1)
Aborted (core dumped)
```

Revision history for this message
Ricardo Amendoeira (ric2b) wrote :

I gave up on waiting and installed flatpak just to install the flatpak version of deluge. That works just fine.

Revision history for this message
Thomas Debesse (illwieckz) wrote (last edit ):

I also gave up and installed flatpak.

In fact the new version of Ubuntu is expected to be out while I write this message (I haven checked), meaning Deluge was broken for a whole 6 month cycle. In fact, I remember that one or two 6-month cycles before, it had a bug preventing to move downloaded files and that bug lasted for 6 months. And before this other broken cycle, Deluge was not usable at all (in a similar way to what we experienced this time) for the previous 6-months cycle.

So basically, by using Ubuntu, Deluge is only usable for 6 months every year, or 12 months every 18 months when lucky, and sometime with strong bugs when it runs.

I'm already updating to the next Ubuntu, but I gave up on Deluge front anyway, I installed the Deluge flatpak and moved the standard Deluge config folder to the flatpak config folder.

I wonder if I will not only give up on Deluge only but also give up on Ubuntu after 16 years of using it and recommending it to everyone: Deluge only works in 1 release on 2 or 3, Firefox is riddled with bugs since the snapification of it, And Nautilus bugs are just programmed to expire by requesting things the bug can't provide per se (as seen in bug 2018555 ).

Edit: And when updating from lunar to mantic, dpkg failed to update libc6 package and aborted the update because of a file conflict between a file from a libc6 package from mantic and a file from a libc6 package from lunar (see bug 2039234 ). What a mess.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.