GNOME Bugzilla – Bug 503343
Can't load playlist files
Last modified: 2008-08-31 20:09:57 UTC
Please describe the problem: Serpentine can't load playlist files. The following exception is thrown each time the 'entry-parsed' signal is fired: Traceback (most recent call last):
+ Trace 181721
val = data[src_key]
Steps to reproduce: Actual results: Expected results: Does this happen every time? Yes Other information: Forwarded from http://bugs.debian.org/455506
def _on_entry_parsed(self, parser, uri, data, hints_list): hints = {'location': uri} for src_key, dst_key in (('title', 'title'), ('author', 'artist')): val = data[src_key] if val is not None: data[dst_key] = val hints_list.append(hints) It appears that type(data) == <type 'gobject.GPointer'>. Which can not be used as a list.
From totem-pl-parser.h: /* signals */ void (*entry_parsed) (TotemPlParser *parser, const char *uri, GHashTable *metadata); So it looks like the GHashTable is not being converted into a dict-like object as Serpentine expects. Maybe this is a bug in pygtk?
/** * TotemPlParser::entry-parsed: * @parser: the object which received the signal * @uri: the URI of the entry parsed * @metadata: a #GHashTable of metadata relating to the entry added * * The ::entry-parsed signal is emitted when a new entry is parsed. */ totem_pl_parser_table_signals[ENTRY_PARSED] = g_signal_new ("entry-parsed", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (TotemPlParserClass, entry_parsed), NULL, NULL, totemplparser_marshal_VOID__STRING_POINTER, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_POINTER); It is not possible to wrap this. There is no runtime information that says the second signal parameter is a GHashTable*. As far as pygobject knows, the parameter type is void*. Not make this work, totem-plparser needs to register custom GType for the metadata parameter, and gnome-python-desktop needs to register a to-python conversion handler for that GType. I don't know why is serpentine expecting a dict; surely this never worked before, so we can't say it's a regression. Certainly it is not critical.
I fixed it by mapping into a python dict. So, sorry but serpentine will have to adapt, I guess. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
(In reply to comment #4) > I fixed it by mapping into a python dict. So, sorry but serpentine will have > to adapt, I guess. > > This problem has been fixed in the development version. The fix will be > available in the next major software release. Thank you for your bug report. > Damn it! I wrote this code, but instead of committing it I must have accidentally reverted it and now can't find it anywhere :-(
gjc@dark-tower:gnome-python-desktop$ svn ci -m "[Bug 503343] Can't load playlist files" Sending ChangeLog Sending totem/plparsermodule.c Transmitting file data .. Committed revision 495.