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 749092 - gdb pretty-printers fail on Python 3 with a TypeError: iter() returned non-iterator of type '_iterator'
gdb pretty-printers fail on Python 3 with a TypeError: iter() returned non-it...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-05-08 06:54 UTC by Marius Gedminas
Modified: 2015-12-16 05:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix Python 3 TypeError in gdb pretty-printers (610 bytes, patch)
2015-05-08 06:54 UTC, Marius Gedminas
none Details | Review

Description Marius Gedminas 2015-05-08 06:54:31 UTC
Created attachment 303060 [details] [review]
Fix Python 3 TypeError in gdb pretty-printers

Python 3 compatibility in bug 720635 was incomplete: iterators need to define __next__.  This was fixed in gobject.py in 7991178a752a22274950e54dc4f05b55ae54d756, but glib.py also has two custom iterators.
Comment 1 Olivier Crête 2015-07-20 19:57:15 UTC
Any chance we can get this one in? Would be really useful to put it into a stable release too as recent distros are not building gdb against Python 3.
Comment 2 Peter Wu 2015-09-25 12:03:27 UTC
Attachment 303060 [details] works for me. Existing installations can be patched with:

python
import glib
glib.GListPrinter._iterator.__next__ = glib.GListPrinter._iterator.next
glib.GHashPrinter._iterator.__next__ = glib.GHashPrinter._iterator.next
end
Comment 3 Peter Wu 2015-11-28 22:58:46 UTC
(cc'ing Alexander as he is the original committer)

The patch is still missing in glib2 2.46.2 and git master. It still works, can it be merged?
Comment 4 Olivier Crête 2015-12-16 00:46:17 UTC
mclasen said it was fine to push this on IRC, so pushing it!


commit c935237e75c4ed770d9efc9e8bd3be109889d994
Author: Marius Gedminas <marius@gedmin.as>
Date:   Fri May 8 02:54:00 2015 -0400

    glib.py: Fix Python 3 TypeError in gdb pretty-printers
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749092
Comment 5 Marius Gedminas 2015-12-16 05:51:04 UTC
Thank you!