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 697363 - Pango.break_ not accessible
Pango.break_ not accessible
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-04-05 14:58 UTC by Christoph Reiter (lazka)
Modified: 2013-04-18 20:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove Python keyword escapement in Repository.find_by_name (4.31 KB, patch)
2013-04-11 11:17 UTC, Simon Feltman
committed Details | Review

Description Christoph Reiter (lazka) 2013-04-05 14:58:00 UTC
>>> from gi.repository import Pango
>>> "break_" in dir(Pango)
True
>>> "break" in dir(Pango)
False
>>> Pango.break_
Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
  • File "/usr/lib/python2.7/dist-packages/gi/module.py", line 316 in __getattr__
    return getattr(self._introspection_module, name)
  • File "/usr/lib/python2.7/dist-packages/gi/module.py", line 135 in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Pango' object has no attribute 'break_'
>>> getattr(Pango, "break")
<function break_ at 0x7f46e3eb0758>
>>> "break" in dir(Pango)
True
Comment 1 Simon Feltman 2013-04-11 11:17:07 UTC
Created attachment 241242 [details] [review]
Remove Python keyword escapement in Repository.find_by_name

Strip trailing underscore from module level items before
calling g_irepository_find_by_name. This fixes a problem
with GI module level items having the same name as a Python
keyword raising an AttributeError during access (Pango.break_).
Comment 2 Martin Pitt 2013-04-18 04:34:11 UTC
Comment on attachment 241242 [details] [review]
Remove Python keyword escapement in Repository.find_by_name

Thanks! This looks good to me, also for the -3.8 branch.
Comment 3 Simon Feltman 2013-04-18 20:54:06 UTC
Attachment 241242 [details] pushed as 99872a1 - Remove Python keyword escapement in Repository.find_by_name