Bug 804060

Summary: Using "from gi.repository import GObject" and "import gobject" results in a warning.
Product: [Fedora] Fedora Reporter: Thomas Woerner <twoerner>
Component: pygobject3Assignee: John Keck <jkeck>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: icq, jkeck
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-31 21:15:38 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Thomas Woerner 2012-03-16 08:54:12 EDT
Description of problem:
Using "import gobject" and "from gi.repository import GObject" results in a warning. This is bad if you are importing projects using another method to import it.

/usr/lib64/python2.7/site-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject

Version-Release number of selected component (if applicable):
pygobject3-3.1.1-1.fc17.x86_64

How reproducible:
Always

Additional info:

The import order is important:


# python
Python 2.7.2 (default, Jan  4 2012, 20:44:07) 
[GCC 4.7.0 20120103 (Red Hat 4.7.0-0)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gobject
>>> from gi.repository import GObject
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/gi/__init__.py", line 23, in <module>
    from ._gi import _API, Repository
ImportError: could not import gobject (error was: ImportError('When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject".',))
>>> 

# python
Python 2.7.2 (default, Jan  4 2012, 20:44:07) 
[GCC 4.7.0 20120103 (Red Hat 4.7.0-0)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import GObject
>>> import gobject
/usr/lib64/python2.7/site-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
>>>
Comment 2 Fedora End Of Life 2013-07-03 18:58:51 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 3 Fedora End Of Life 2013-07-31 21:15:44 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.