Re: A few possible bugs



On 04/20/2013 02:40 AM, Simon Feltman wrote:
Hi Cole,

Comments below.

On Mon, Apr 15, 2013 at 10:02 AM, Cole Robinson <crobinso redhat com
<mailto:crobinso redhat com>> wrote:

    - Gdk.EventType has an attribute called 2BUTTON_PRESS, but that's an invalid
    name in python. I noticed there's a _2BUTTON_PRESS, so maybe that was the
    compromise.
a similar issue.

This is an unfortunate side affect of splitting what is a valid C identifier
up into namespace.identifier. Luckily this is the only occurrence I've seen so
far, but it seems it also had the same name in PyGTK (gtk.gdk._2BUTTON_PRESS).
There isn't much we can do about this beyond either logging a GTK+ bug which
attempts to additionally add an alias which is nicer for GI or do so in the
bindings, using an additional spelled out alias or something like that
(DOUBLE_BUTTON_PRESS). The underscore in Python does make it feel like a
private attribute.


Hmm, okay, I didn't take any action with this. But maybe some part of either
gobject-introspection or pygobject should when it generates names that aren't
valid in python. Granted you can still access that variable in roundabout ways
with getattr etc.

    - dir(GLib.IConv) lists a parameter named ''  (the empty string)


Funny, it looks like this is caused by the function named "g_iconv". GI is
stripping iconv off to get rid of the class name on the method and there is
nothing left. I would log this as a GLib bug which specifies the method should
have a "Rename to:" annotation to something like "g_iconv_convert" or
"g_iconv_iconv". The GI scanner should probably at least warn when this kind
of thing happens because g_base_info_get_name is returning the empty string.

In [1]: from gi.repository import GLib
In [2]: iconv = getattr(GLib.IConv, '')
In [3]: iconv.__info__.get_name()
Out[3]: ''


I filed a bug against glib/introspection:

https://bugzilla.gnome.org/show_bug.cgi?id=698473

Maybe the scanner can just fix up cases like this and rename the function to
g_FOO_FOO on the fly.

    - GObject.threads_init(), GLib.IO_IN, etc. don't show up in the dir() output.
    They obviously work fine, but it's potentially confusing for the user.


Please log this as PyGObject bug.


https://bugzilla.gnome.org/show_bug.cgi?id=685076

    - Gtk.Container.child_get_property() requires a GObject.Value() instance to be
    passed in. Ideally it would work like GObject.get_property(), which just
    returns the python converted value. Though changing this now would break
    existing users, though it could be changed in a back compat way no doubt.


I definitely agree that this needs to be fixed, we can make it backwards
compatible by accepting the GValue out arg as being optional, if not passed it
just returns a marshaled value. There is already this ticket which I will
update with the backwards compatible
idea: https://bugzilla.gnome.org/show_bug.cgi?id=685076

style_get_property has the same issue, I added a comment to that effect on the bz.

Thanks Simon!

- Cole


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]