Bug 767998 - Python gobject introspection failing for NetworkManager.80211* attributes (invalid syntax)
Summary: Python gobject introspection failing for NetworkManager.80211* attributes (in...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: pygobject3
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Colin Walters
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-15 13:44 UTC by Radek Vykydal
Modified: 2016-07-19 10:04 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-19 10:04:58 UTC
Type: ---


Attachments (Terms of Use)

Description Radek Vykydal 2011-12-15 13:44:03 UTC
To quote Daniel Drake from Sugar:
(http://mail.gnome.org/archives/python-hackers-list/2011-August/msg00002.html)

> >>> from gi.repository import NetworkManager
> >>> '80211ApFlags' in dir(NetworkManager)
> True
> >>> NetworkManager.80211ApFlags
>   File "<stdin>", line 1
>     NetworkManager.80211ApFlags
>                        ^
> SyntaxError: invalid syntax
>.
> >>> getattr(NetworkManager, "80211ApFlags")
>.
> /usr/lib/python2.7/site-packages/gi/module.py:113: Warning: type name
> `80211ApFlags' contains invalid characters
> ** (process:2252): CRITICAL **: pyg_flags_add: assertion `typename !=
> NULL' failed
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.7/site-packages/gi/module.py", line 270, in __getattr__
>     return getattr(self._introspection_module, name)
>   File "/usr/lib/python2.7/site-packages/gi/module.py", line 113, in __getattr__
>     wrapper = flags_register_new_gtype_and_add(info)
> SystemError: error return without exception set

Or the fail can be observed calling NMClient.AccessPoint.get_flags:

Python 2.7.2 (default, Jul  8 2011, 18:54:16) 
[GCC 4.6.1 20110627 (Red Hat 4.6.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import NMClient
>>> client = NMClient.Client.new()
>>> devs = client.get_devices()
>>> wireless_dev = devs[0]
>>> aap = wireless_dev.get_active_access_point()
>>> aap.get_flags()
/usr/lib/python2.7/site-packages/gi/module.py:117: Warning: type name `80211ApFlags' contains invalid characters
  wrapper = flags_register_new_gtype_and_add(info)
 
** (process:3005): CRITICAL **: pyg_flags_add: assertion `typename != NULL' failed
Segmentation fault (core dumped)

The problem seems to be generated python attribute starting with number.

We'd like to use libnm-glib with gi introspection instead of dbus interface in Anaconda. I've read about similar plans for Sugar (by Daniel Drake).

Comment 1 Fedora End Of Life 2013-01-16 13:08:55 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. 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 '16'.

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 16'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 16 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 to click on 
"Clone This Bug" and open it against that version of Fedora.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Fedora End Of Life 2013-02-13 13:50:01 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 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.

Comment 3 Vratislav Podzimek 2013-02-18 10:37:30 UTC
I believe the best solution is the one that Gdk uses for a similar issue -- define underscore prefixed attributes in Python overrides. [1]

[1] http://git.gnome.org/browse/pygobject/tree/gi/overrides/Gdk.py#n164

Comment 4 Fedora End Of Life 2013-12-21 14:59:07 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. 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 '18'.

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 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 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 18'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 5 Fedora End Of Life 2015-05-29 08:41:52 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. 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 EOL if it remains open with a Fedora  'version'
of '20'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 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 this bug is closed as described in the policy above.

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 6 Fedora End Of Life 2015-06-30 00:35:19 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 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. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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

Comment 7 Radek Vykydal 2015-09-03 08:34:27 UTC
Still hitting the problem in libnm.

How about creating NM python gi overrides with attributes prefixed with underscore as proposed in comment #3 so we don't have to do:

NM._80211ApFlags = getattr(NM, "80211ApFlags")
NM._80211ApSecurityFlags = getattr(NM, "80211ApSecurityFlags")
NM._80211Mode = getattr(NM, "80211Mode")

to use the attributes.

Comment 8 Jirka Klimes 2015-09-03 09:38:59 UTC
(In reply to Radek Vykydal from comment #7)
> Still hitting the problem in libnm.
> 
> How about creating NM python gi overrides with attributes prefixed with
> underscore as proposed in comment #3 so we don't have to do:
> 
> NM._80211ApFlags = getattr(NM, "80211ApFlags")
> NM._80211ApSecurityFlags = getattr(NM, "80211ApSecurityFlags")
> NM._80211Mode = getattr(NM, "80211Mode")
> 
> to use the attributes.

It sounds to me as a good idea. However, I do not know python and the stuff enough to do it myself. Moreover, it would have to be done in python GObject introspection.
Radek, Vratislav are you able to prepare the override file?

Comment 9 Colin Walters 2015-09-03 13:23:18 UTC
I think there are other cases in which pygobject automatically prepends '_', would makes sense to me to do here.

Comment 10 Vratislav Podzimek 2015-09-04 08:00:22 UTC
(In reply to Jirka Klimes from comment #8)
> (In reply to Radek Vykydal from comment #7)
> > Still hitting the problem in libnm.
> > 
> > How about creating NM python gi overrides with attributes prefixed with
> > underscore as proposed in comment #3 so we don't have to do:
> > 
> > NM._80211ApFlags = getattr(NM, "80211ApFlags")
> > NM._80211ApSecurityFlags = getattr(NM, "80211ApSecurityFlags")
> > NM._80211Mode = getattr(NM, "80211Mode")
> > 
> > to use the attributes.
> 
> It sounds to me as a good idea. However, I do not know python and the stuff
> enough to do it myself. Moreover, it would have to be done in python GObject
> introspection.
> Radek, Vratislav are you able to prepare the override file?
Yes, we should be able to do that.

Comment 11 Vratislav Podzimek 2015-09-04 08:01:14 UTC
(In reply to Colin Walters from comment #9)
> I think there are other cases in which pygobject automatically prepends '_',
> would makes sense to me to do here.
Automatically? I remember some overrides like these in Gtk.py (Gtk's overrides), but nothing like that happening automatically.

Comment 12 Colin Walters 2015-09-04 12:24:20 UTC
$ basename $(pwd)
pygobject
$ git describe --tags --always --abbrev=42
3.17.90-1-ge2b8ba0584d1a3273dfa2fcb23616d1dc68fdb8e

Where we are.

$ git grep '"_" '

Hmm, no hits, let's try "'":

$ git grep "'_' "
gi/gobjectmodule.c:              /* canonicalize signal name, replacing '-' with '_' */
gi/overrides/keysyms.py:            target = '_' + target
$

Ah hah.  Yes, there is override code just for GTK keysyms, which have the same problem.  I don't see a reason not to generalize that to all identifiers, but it's something to take up with pygobject upstream.

Comment 13 Fedora Admin XMLRPC Client 2016-01-27 17:42:53 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 14 Fedora Admin XMLRPC Client 2016-01-27 17:59:06 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 15 Fedora Admin XMLRPC Client 2016-01-27 18:00:06 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 16 Fedora Admin XMLRPC Client 2016-01-27 18:12:07 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 17 Fedora End Of Life 2016-07-19 10:04:58 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

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


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