python3-xmmsclient glib connector outdated and doesn't work

Bug #1945885 reported by Kevin Pulo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xmms2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Fresh Hirsuite install, with python3-xmmsclient and python3-gi packages installed. Importing `xmmsclient.glib` fails, because it's trying to load from the (python2-era) `gobject` module:

```
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 21.04
Release: 21.04
Codename: hirsute
$ apt-cache policy python3-xmmsclient
python3-xmmsclient:
  Installed: 0.8+dfsg-21build1
  Candidate: 0.8+dfsg-21build1
  Version table:
 *** 0.8+dfsg-21build1 500
        500 http://au.archive.ubuntu.com/ubuntu hirsute/universe amd64 Packages
        100 /var/lib/dpkg/status
$ apt-cache policy python3-gi
python3-gi:
  Installed: 3.38.0-4
  Candidate: 3.38.0-4
  Version table:
 *** 3.38.0-4 500
        500 http://au.archive.ubuntu.com/ubuntu hirsute/main amd64 Packages
        100 /var/lib/dpkg/status
$
$ python3
Python 3.9.5 (default, May 11 2021, 08:20:37)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmmsclient.xlib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'xmmsclient.xlib'
>>>
$
```

The fix appears to be to change this line in xmmsclient/glib.py:

    from gobject import io_add_watch, IO_OUT, IO_IN, source_remove

to instead read:

    from gi.repository.GLib import io_add_watch, IO_OUT, IO_IN, source_remove

This allows the module to load and function as expected.

Revision history for this message
Kevin Pulo (devkev) wrote :

Sorry, I typo'd the test command and didn't realise before submitting the bug report. This is the correct error:

$ python3
Python 3.9.5 (default, May 11 2021, 08:20:37)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmmsclient.glib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/xmmsclient/glib.py", line 13, in <module>
    from gobject import io_add_watch, IO_OUT, IO_IN, source_remove
ModuleNotFoundError: No module named 'gobject'
>>>
$

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.