GNOME Bugzilla – Bug 576145
pygst programs skip python plugins on registry update
Last modified: 2009-04-11 14:26:13 UTC
I noticed that pygst programs print this every now and then on import gst: AttributeError: 'module' object has no attribute 'Element' Turns out that when a pygst program triggers a registry update, python plugins are skipped. The problem is that when "import gst" triggers the registry update, the python plugin loader also imports the gst module -- which at that point is only partially initialized. It's a tricky circular dependency because any python plugin needs the gst module fully setup in order to declare a gst.Element subclass on import time.
Tricky one indeed. It'll only happen if there are new python elements, right ? Maybe we could figure out a way to delay the registry initialisation to 'after' the python module loading. Maybe splitting out the registry-readin/checking part of gst_init() til after. We could: * set GST_REGISTRY_UPDATE to "no" when we call gst_init(), * then load the rest of the python module, * and *then* do the registry scanning (if GST_REGISTRY_UPDATE wasn't set to "no" before loading the python module).
*** Bug 571536 has been marked as a duplicate of this bug. ***
*** Bug 574272 has been marked as a duplicate of this bug. ***
We can't release without this fixed.
Created attachment 132512 [details] [review] Postpone registry update until after _gst module is initialized This implements the idea in comment #1 and seems to fix the issues.
commit 9a8db128d0a58b2c999d5b31a093a0648472c338 Author: Edward Hervey <bilboed@bilboed.com> Date: Sat Apr 11 16:08:51 2009 +0200 __init__: Postpone registry update during initialization. Fixes #576145