"[ERROR] Scanning file: ..., cannot unpack non-iterable MapInfo object" with gstreamer 1.17.2
Environment
- Lollypop version: 1.13.3
- GTK+ version: 3.24.21
- Operating system: Linux (Debian experimental)
- Gstreamer:
- gir1.2-gst-plugins-base-1.0 1.17.2
- gir1.2-gstreamer-1.0 1.17.2
- python3-gst-1.0 1.17.2
Bug
After installing the Gstreamer 1.17.2 stack (including python-gst) I noticed error messages like these in my systemd journal
Aug 08 13:42:59 nuc8 org.gnome.Lollypop.desktop[5650]:
[ERROR] 2020-08-08 13:42:59 Scanning file: file:///some.mp3, cannot unpack non-iterable MapInfo object
This error is emitted from lollypop/tagreader.py
def get_popm(self, tags):
...
size = tags.get_tag_size("private-id3v2-frame")
for i in range(0, size):
(exists, sample) = tags.get_sample_index("private-id3v2-frame", i)
if not exists:
continue
(exists, m) = sample.get_buffer().map(Gst.MapFlags.READ) # ERROR
After some digging I found the reason: python-gst 1.17 added an override for Gst.Buffer.map()
If buf
is some Gst.Buffer
, Gstreamer 1.16 (with or without python-gst installed)
buf.map(Gst.MapFlags.READ)
would return a pair
(True, info=<Gst.MapInfo object at 0x7f5b326e79f0 (void at 0x13d36e0)>)
That still holds in 1.17 unless you also install gst-python 1.17, then it returns a single value
<gi.overrides.Gst.MapInfo object at 0x7fb9558129a0>
hence the unpacking of the return value into (exists, m)
triggers an iteration over this object
(which it doesn't support).
For now, I can workaround this problem by deinstalling python-gst.