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 702787 - Remove lines form pygtkcompat.py that broke GTK3 pygi scripts
Remove lines form pygtkcompat.py that broke GTK3 pygi scripts
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.9.x
Other Windows
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-21 04:53 UTC by Fan, Chun-wei
Modified: 2013-06-21 05:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove lines that prevented GTK3 pygi scripts running (1.51 KB, patch)
2013-06-21 04:53 UTC, Fan, Chun-wei
none Details | Review

Description Fan, Chun-wei 2013-06-21 04:53:57 UTC
Created attachment 247404 [details] [review]
Remove lines that prevented GTK3 pygi scripts running

Hi,

As I was attempting to run the gtk-demo PyGI program on Windows that is taken from the PyGObject git checkout, it seems that the following lines:
Gdk.pixbuf_new_from_file_at_scale = GdkPixbuf.Pixbuf.new_from_file_at_scale (line 142)
and
Gtk.clipboard_get = Gtk.Clipboard.get (line 352)

prevented the demo GTK3 pygi scripts from running with error messages such as:

AttributeError: type object 'Pixbuf' has no attribute 'new_from_file_at_scale'
AttributeError: type object 'Clipboard' has no attribute 'get'

which leads me to believe that there were some changes in PyGObject that necessitated this change, at least that was the case for me on Windows, but I think it might hit other platforms as well.

So, here's the patch to remove those offending lines.

With blessings,
Thank you!
Comment 1 Martin Pitt 2013-06-21 05:26:41 UTC
These are backwards compatibility declarations for old method names that pygtk offered.

gdk_pixbuf_new_from_file_at_scale() was introduced in gdk-pixbuf 2.6, so maybe you have an older version? It's certainly there for me in /usr/share/gir-1.0/GdkPixbuf-2.0.gir

Likewise, /usr/share/gir-1.0/Gtk-3.0.gir has gtk_clipboard_get(), but perhaps that doesn't exist on Windows. So I'll make these two conditional instead, as they are required on Linux.
Comment 2 Martin Pitt 2013-06-21 05:29:42 UTC
Fixed in https://git.gnome.org/browse/pygobject/commit/?id=61b268e44

Thanks!