Bug 1474097 - [python2-debug] unable to import "gi" module
[python2-debug] unable to import "gi" module
Product: Fedora
Classification: Fedora
Component: python2 (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Charalampos Stratakis
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2017-07-23 17:00 EDT by Christian Stadelmann
Modified: 2017-08-07 14:38 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-08-07 07:34:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Christian Stadelmann 2017-07-23 17:00:17 EDT
Description of problem:
python2-debug cannot run ordinary code which runs fine from python2 binary.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. run `$ python2-debug`
2. in python2, run `>>> from gi.repository import Gtk`

Actual results:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 42, in <module>
    from . import _gi
ImportError: cannot import name _gi
[47360 refs]

Expected results:
It should work fine, as it does in "normal" python2.
Comment 1 Petr Viktorin 2017-08-07 07:34:42 EDT
The debug build has a different C API, so any C extensions (such as _gi) will not work with it.
If you need to debug _gi, you'll need to build it from source against python-debug.

Feel free to ask for clarifications or reopen the bug if that didn't help!
Comment 2 Christian Stadelmann 2017-08-07 14:38:58 EDT
(In reply to Petr Viktorin from comment #1)
> The debug build has a different C API, so any C extensions (such as _gi)
> will not work with it.

Thanks for your explanation and sorry for the noise.

Note You need to log in before you can comment on or make changes to this bug.