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 709926 - "TypeError: 'NoneType' object is not iterable" when calling Widget.drag_dest_set_target_list or Widget.drag_source_set_target_list
"TypeError: 'NoneType' object is not iterable" when calling Widget.drag_dest_...
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.10.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-10-11 16:44 UTC by Nuno Araujo (IRC: russo79)
Modified: 2013-10-14 08:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix TypeError when setting drag target_list to None (2.90 KB, patch)
2013-10-11 16:47 UTC, Nuno Araujo (IRC: russo79)
committed Details | Review

Description Nuno Araujo (IRC: russo79) 2013-10-11 16:44:00 UTC
When calling Widget.drag_dest_set_target_list(None) or Widget.drag_source_set_target_list(None) a "TypeError: 'NoneType' object is not iterable" if thrown.

According to Gtk documentation [1] [2], this shouldn't be the case since client code should be able to pass NULL in calls made to gtk_drag_dest_set_target_list and gtk_drag_source_set_target_list.

[1] https://developer.gnome.org/gtk3/3.10/gtk3-Drag-and-Drop.html#gtk-drag-dest-set-target-list
[2]  https://developer.gnome.org/gtk3/3.10/gtk3-Drag-and-Drop.html#gtk-drag-source-set-target-list
Comment 1 Nuno Araujo (IRC: russo79) 2013-10-11 16:47:28 UTC
Created attachment 257026 [details] [review]
Fix TypeError when setting drag target_list to None

Attached patch changes the Widget overridden methods to check if the passed param is None and do not try to create a Gtk.TargetList if this is the case passing None to the 'introspected' method.
Comment 2 Martin Pitt 2013-10-14 08:08:02 UTC
Thanks! Applied to master and 3-10 branch.