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 687335 - Overrides module in sys.path before pygobject breaks importing gi
Overrides module in sys.path before pygobject breaks importing gi
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
: 689272 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-11-01 11:32 UTC by Lukas Vacek
Modified: 2018-01-10 20:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Lukas Vacek 2012-11-01 11:32:06 UTC
As discussed on python-hackers-list,

The problem is that an overrides module which lives in different directory than pygobject needs to install its own __init__.py (and call pkgutil.extend_path in there).

Then we have two "gi/overrides/__init__.py" in sys.path and which one gets loaded depends on the order of sys.path. In case pygobject is first in sys.path, everything goes fine. In case an overrides module is first in sys.path, all breaks.

The suggestions so far are:
- symlink __init__.py from overrides module to pygobject's gi/overrides
- see if .pkg files or pkg_resources.declare_namespace could help the situation
- turn gi/overrides/ into a pure namespace package by removing code from the __init__.py (I think we should do this in any case) but this will take a deprecation cycle. (PEP-0420)

Thanks,
Lukas
Comment 1 Lukas Vacek 2012-11-01 13:53:54 UTC
- Simon in the email also suggested to use pkg_resources.declare_namespace
Comment 2 Martin Pitt 2013-02-27 16:36:10 UTC
*** Bug 689272 has been marked as a duplicate of this bug. ***
Comment 3 GNOME Infrastructure Team 2018-01-10 20:19:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/35.