After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 576145 - pygst programs skip python plugins on registry update
pygst programs skip python plugins on registry update
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other Linux
: High blocker
: 0.10.15
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 571536 574272 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-03-21 01:47 UTC by René Stadler
Modified: 2009-04-11 14:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Postpone registry update until after _gst module is initialized (832 bytes, patch)
2009-04-11 14:10 UTC, Edward Hervey
committed Details | Review

Description René Stadler 2009-03-21 01:47:41 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.
Comment 1 Edward Hervey 2009-03-21 08:34:04 UTC
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). 
Comment 2 Edward Hervey 2009-03-24 10:29:49 UTC
*** Bug 571536 has been marked as a duplicate of this bug. ***
Comment 3 Edward Hervey 2009-03-24 10:29:58 UTC
*** Bug 574272 has been marked as a duplicate of this bug. ***
Comment 4 Edward Hervey 2009-03-24 10:30:47 UTC
We can't release without this fixed.
Comment 5 Edward Hervey 2009-04-11 14:10:08 UTC
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.
Comment 6 Edward Hervey 2009-04-11 14:26:13 UTC
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