GNOME Bugzilla – Bug 687335
Overrides module in sys.path before pygobject breaks importing gi
Last modified: 2018-01-10 20:19:56 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
- Simon in the email also suggested to use pkg_resources.declare_namespace
*** Bug 689272 has been marked as a duplicate of this bug. ***
-- 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.