commit bb12e652d661cf6ce931b44a89c11951894101bf Author: Martin Pitt Date: Mon Mar 4 17:27:50 2013 +0100 release 3.7.91 NEWS | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) commit 25a6f90f28b065dd4f1cd352826598577402dc0b Author: Martin Pitt Date: Mon Mar 4 17:16:22 2013 +0100 Dot not clobber original Gdk/Gtk functions with overrides https://bugzilla.gnome.org/show_bug.cgi?id=686835 gi/overrides/Gdk.py | 3 ++- gi/overrides/Gtk.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) commit d50d16428edf42799489fe1befbc4ce56f0fa181 Author: Martin Pitt Date: Mon Mar 4 15:30:31 2013 +0100 tests: Reorganize GError and GClosure tests Split TestGClosure.test_gclosure_in() into its three components. Merge the various TestGError* classes into one, to match the structure of the other tests. tests/test_gi.py | 59 +++++++++++++++++++++++++------------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) commit 8cfd596c7849bf78a74fee04630fbbb104f02080 Author: Martin Pitt Date: Mon Mar 4 15:16:25 2013 +0100 Fix memory leaks in property setting/getting Do not leak GValues and string arrays, free them properly. As we always free the intermediate GValues, use g_value_dup_boxed() instead of g_value_get_boxed() when appropriate. Detected by test_gi.TestPropertiesObject.test_strv test case. gi/pygi-property.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) commit eec8c3a932d42e92ccaf7f97d3d90948842e263f Author: Martin Pitt Date: Mon Mar 4 12:43:24 2013 +0100 Fix memory leak in pyg_flags_get_value_nicks() Discovered by test_gi.TestKeywords.test_uppercase() test. gi/_gobject/pygflags.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) commit 002a834dd993b82508a4fe262269befcf1a6d341 Author: Martin Pitt Date: Mon Mar 4 12:10:03 2013 +0100 Fix memory leak in _pygi_argument_to_array() Free the originally allocated GArray data before setting it to our already existing C array. Discovered by test_gi.TestStructure.test_boxed_struct_return test case. gi/pygi-argument.c | 1 + 1 file changed, 1 insertion(+) commit d32b410a1b1fcca6d10d75fbd771ea789999da64 Author: Martin Pitt Date: Mon Mar 4 10:19:34 2013 +0100 Fix leaking inout C arrays g_*_info_invoke() changes the original state->in_args and state->args C arrays to the output values for (inout) arguments, thus losing the pointer to the originally allocated array. Remember that in state->args_data, so that we can free it in _pygi_marshal_cleanup_from_py_array(). Reproduced by test_gi.TestArray.test_array_fixed_inout test case. gi/pygi-marshal-cleanup.c | 6 ++++++ gi/pygi-marshal-from-py.c | 4 ++++ 2 files changed, 10 insertions(+) commit e4098cbc28ff9324fa851bca2e423da4e51b5091 Author: Martin Pitt Date: Fri Mar 1 15:12:31 2013 +0100 Fix leak in _PyGI_ERROR_PREFIX() Properly clean up our allocated py_error_prefix string. Fixes memory leak in e. g. test_gi.TestArray.test_array_fixed_int_in. gi/pygi-private.h | 1 + 1 file changed, 1 insertion(+) commit b388c3e87ce86d26560337c88eb33d0a95647db8 Author: Martin Pitt Date: Fri Mar 1 15:01:06 2013 +0100 Fix leaking of boxed array elements Commit 631d8ef879a copies struct array elements, but this needlessly duplicates and leaks the array element for boxed types. So only do it for plain structs. This fixes the memory leak with test_gi.TestGValue.test_gvalue_flat_array_out. https://bugzilla.gnome.org/show_bug.cgi?id=693402 gi/pygi-marshal-to-py.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 1dc2bc9f65669417ae1964d70b85f115928b2963 Author: Martin Pitt Date: Fri Mar 1 14:04:34 2013 +0100 Drop gi.overrides.overridefunc() This just adds an unnecessary extra function call and is not really needed. Drop it from the only remaining function which uses this (Gtk.main_quit) and drop overridefunc(). https://bugzilla.gnome.org/show_bug.cgi?id=686835 gi/overrides/Gtk.py | 7 +++---- gi/overrides/__init__.py | 24 ++---------------------- 2 files changed, 5 insertions(+), 26 deletions(-) commit 1edc4ba31b3f9375ec3920aab5b71eb066ee3739 Author: Martin Pitt Date: Fri Mar 1 14:02:02 2013 +0100 Add some tests for overridden Gdk/Gtk functions Add tests for Gtk.main_quit, Gtk.stock_parse(), and Gdk.color_parse(), as we have overrides for them. tests/test_overrides_gdk.py | 7 +++++++ tests/test_overrides_gtk.py | 15 +++++++++++++++ 2 files changed, 22 insertions(+) commit 6f6c0ceff00fea83bc85756b10694f7c96039abc Author: Martin Pitt Date: Fri Mar 1 11:10:01 2013 +0100 Fix GLib.Source ref leak upon destruction In GLib.Source.__del__(), manually unref the source if we are a custom Source. As we use a static binding to create it, the GI part won't unref it for us, leading to finalize() method not being called and the GSource object leaking. https://bugzilla.gnome.org/show_bug.cgi?id=510511 gi/overrides/GLib.py | 4 ++++ tests/test_source.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) commit 91f76dd94fb0afc6888a821a31c3a4e2e053360e Author: Martin Pitt Date: Thu Feb 28 15:08:56 2013 +0100 Add performance test for Gtk.ListStore.append We are going to optimize this in various ways, so let's measure it. tests/test_overrides_gtk.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) commit b1ff74b085bdca72c272f019be4dd387073a991a Author: Simon Feltman Date: Thu Feb 28 04:32:30 2013 -0800 Optimize GValue.get/set_value by setting GValue.g_type to a local This increases performance by a factor of 2x for types later in the dispatch. https://bugzilla.gnome.org/show_bug.cgi?id=694857 gi/overrides/GObject.py | 98 +++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 47 deletions(-) commit 105e6738ee249b64904da26ae45dd273ca4eeba8 Author: Martin Pitt Date: Thu Feb 28 11:43:47 2013 +0100 Fix leak of caller-allocated boxed values Add a new "allocated_slice" argument to _pygi_boxed_new() which specifies whether its "boxed" pointer was allocated using a slice (by giving its size) or malloc (by specifying 0), as _pygi_boxed_new cannot determine that itself any more. Use this in _pygi_marshal_to_py_interface_struct() for caller-allocated boxed values, as _caller_alloc() uses _pygi_boxed_alloc() for those (i. e. slices), which would otherwise leak. Thanks to Mike Gorse for the original patch! https://bugzilla.gnome.org/show_bug.cgi?id=691501 gi/gimodule.c | 2 +- gi/pygi-argument.c | 2 +- gi/pygi-boxed.c | 14 ++++++++++---- gi/pygi-boxed.h | 3 ++- gi/pygi-marshal-to-py.c | 6 ++++-- gi/pygi-source.c | 3 ++- 6 files changed, 20 insertions(+), 10 deletions(-) commit 64bcca2d39fed1734ad1abbe291406387e901f5c Author: Martin Pitt Date: Thu Feb 28 10:48:18 2013 +0100 Fix memory handling of caller-allocated boxed types _pygi_marshal_to_py_interface_struct() and other places treat subtypes of G_TYPE_BOXED as boxed values and wrap them with _pygi_boxed_new(). Fix _caller_alloc() and _cleanup_caller_allocates() to consider G_TYPE_BOXED subtypes as well and use the slice allocator instead of malloc()'ing a struct. This avoids trying to free an malloc'ed struct with g_slice_free() and properly cleans up the boxed values. The leak was produced with: G_SLICE=debug-blocks PYTHONPATH=. valgrind --tool=memcheck --leak-check=full --show-possibly-lost=no \ python3 -c 'from gi.repository import Gtk; b=Gtk.TextBuffer(); (s,e) = b.get_bounds()' gi/pygi-invoke.c | 2 +- gi/pygi-marshal-cleanup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) commit 4f5e8b7554b6388aa2d0eb4a3b285d99499163be Author: Martin Pitt Date: Wed Feb 27 23:21:34 2013 +0100 Fix cleanup of GValue arrays Commit bc1fd8 introduced a thinko: We must not change item_arg_cache->from_py_cleanup, as it's a global cache. Revert the original change, and instead put the hack into _pygi_marshal_cleanup_from_py_array(), which now short-circuits _pygi_marshal_cleanup_from_py_interface_struct_gvalue() to avoid trying to release a slice which has never been allocated in _pygi_marshal_from_py_array(). https://bugzilla.gnome.org/show_bug.cgi?id=672224 gi/pygi-marshal-cleanup.c | 11 ++++++++++- gi/pygi-marshal-from-py.c | 10 +++------- 2 files changed, 13 insertions(+), 8 deletions(-) commit 70118c3840b10e1585d066a4be485c097cd23e99 Author: Martin Pitt Date: Wed Feb 27 21:52:43 2013 +0100 Revert "Mark caller-allocated boxed structures as having a slice allocated" This is wrong after all, as it sets slice_allocated to TRUE, but doesn't set a corresponding size. Also, poking in internal fields from that place is ugly; this should rather be fixed in gi/pygi-marshal-cleanup.c _cleanup_caller_allocates(). This reverts commit dc3d21173b75232f7ea0b9913f7309486456a69d. gi/pygi-marshal-to-py.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) commit a51c72c771dafc0c13d7990f1ff3e428dca729a1 Author: Martin Pitt Date: Wed Feb 27 21:51:30 2013 +0100 Run tests with G_SLICE=debug_blocks This will help finding regressions in slice management, like in https://bugzilla.gnome.org/show_bug.cgi?id=691501 tests/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) commit 4f6ebcfe0605a7a593dc3f9dd322a4da9bd091a3 Author: Martin Pitt Date: Wed Feb 27 18:30:23 2013 +0100 Add override helper for stripping boolean returns Introduce a gi.overrides.strip_boolean_result() helper which checks a boolean return value and if True, return the remaining arguments, otherwise return a default. This pattern is being used by a lot of overrides, which get significantly smaller and more consistent that way. https://bugzilla.gnome.org/show_bug.cgi?id=694431 gi/overrides/Gdk.py | 27 +------- gi/overrides/Gtk.py | 156 +++++++++-------------------------------------- gi/overrides/__init__.py | 22 +++++++ 3 files changed, 53 insertions(+), 152 deletions(-) commit 08c97b0bd3140921f1b5c74f7764e23d3a9bf0ee Author: Martin Pitt Date: Wed Feb 27 15:39:23 2013 +0100 Drop obsolete pygobject_register_sinkfunc() declaration There is no definition for this any more, nor is it being used anywhere. https://bugzilla.gnome.org/show_bug.cgi?id=639849 gi/_gobject/pygobject-private.h | 2 -- 1 file changed, 2 deletions(-) commit b6fefd625b843d4fc3dabc456584a2ad27a48c8c Author: Martin Pitt Date: Wed Feb 27 13:41:55 2013 +0100 Fix marshalling of C arrays with explicit length in signal arguments We need _pygi_argument_to_array() from both closure marshalling (where we have the arguments as GIArgument array) and signal closure marshalling (where we have the arguments in a GValue array). Add an alternative "args_values" parameter to _pygi_argument_to_array() so that callers can specify one or the other depending on which type they have available. This allows us to pass on the full argument list for signal closures, so that _pygi_argument_to_array() can access the explicit length argument for an array. This fixes the GSettings:change-event signal. https://bugzilla.gnome.org/show_bug.cgi?id=662241 gi/pygi-argument.c | 36 ++++++++++++++++++++++++++++-------- gi/pygi-argument.h | 1 + gi/pygi-closure.c | 2 +- gi/pygi-info.c | 4 ++-- gi/pygi-signal-closure.c | 3 ++- tests/test_gio.py | 18 ++++++++++++++++++ 6 files changed, 52 insertions(+), 12 deletions(-) commit caeeeb7e4282e183eefc3c53b2d53c8c2bb7de89 Author: Martin Pitt Date: Wed Feb 27 08:07:20 2013 +0100 Fix signedness, overflow checking, and 32 bit overflow of GFlags GFlagsValue.value is a guint, so we must access it as unsigned type. Define two new macros PYGLIB_PyLong_FromUnsignedLong() and PYGLIB_PyLong_AsUnsignedLong() for that purpose, and consistently use them for handling flag values. Use the checked variant of these functions which produce OverflowErrors instead of the unchecked PYGLIB_PyLong_AS_LONG(). Insert zero padding after the PyLongObject in PyGFlags and PyGEnum. Without this, the directly adjacent GType field seems to confuse PyLong_FromUnsignedLong() and includes the GType into the numeric value. https://bugzilla.gnome.org/show_bug.cgi?id=693121 gi/_glib/pyglib-python-compat.h | 8 +++++++ gi/_gobject/gobjectmodule.c | 2 +- gi/_gobject/pygflags.c | 52 +++++++++++++++++++++++++---------------- gi/_gobject/pygobject-private.h | 10 ++++---- gi/_gobject/pygobject.h | 4 ++-- gi/_gobject/pygtype.c | 6 ++--- tests/test_overrides_gdk.py | 15 ++++++++++++ 7 files changed, 67 insertions(+), 30 deletions(-) commit b3a3da37e369f3f5d434c8dc9f3c7f1e74d537ac Author: Chun-wei Fan Date: Tue Feb 26 16:15:36 2013 +0800 gi/pygi-marshal-from-py.c: Fix build on Visual C++ Since Visual C++ does not provide the INFINITY and NAN constants in its math.h (they are items defined by C99), provide fallback implementations for it here. The INFINITY constant can be provided with HUGE_VAL, since we are using INFINITY to check the value of a variable of double type, and we could use a rather simple workaround for NAN. Also avoid declaring variables in the middle of the block. https://bugzilla.gnome.org/show_bug.cgi?id=692856 gi/pygi-marshal-from-py.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) commit 5210e3d5bb7936a21b6a2c938ede505bf1d848c9 Author: Martin Pitt Date: Tue Feb 26 16:42:19 2013 +0100 Fix some style issues with previous patch gi/pygi-cache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) commit 999679beaa9f5b36d9483abdbd30cd5e113b6bf6 Author: Martin Pitt Date: Tue Feb 26 10:15:22 2013 +0100 Raise DeprecationWarning on deprecated callables Check if a callable is marked as deprecated and raise a DeprecationWarning in that case. Notes: - Python hides DeprecationWarning by default, you need to enable them with -Wd - The deprecation message is currently not in the typelib (bug #694728) https://bugzilla.gnome.org/show_bug.cgi?id=665084 gi/pygi-cache.c | 14 ++++++++++++++ tests/test_gi.py | 10 ++++++++++ 2 files changed, 24 insertions(+) commit 9f8258cfdcf562aa6cf37b9e66075b7f6a6ed97a Author: Simon Feltman Date: Mon Feb 18 00:39:45 2013 -0800 pygtkcompat: Add Widget.window, scroll_to_mark, and window methods Fix gi.pygtkcompat attempting relative import in Python < 3.0. Add Gtk.Widget.window property which uses get_window() Add Gtk.TextView.scroll_to_mark with defaults Add Gtk.window_list_toplevels and Gtk.window_set_default_icon_name https://bugzilla.gnome.org/show_bug.cgi?id=694067 gi/pygtkcompat.py | 2 ++ pygtkcompat/pygtkcompat.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) commit e8e2bbee7bb79039bbd9a968f7db88438bd937f9 Author: Simon Feltman Date: Sun Dec 16 02:56:06 2012 -0800 pygtkcompat: Add Gtk.Window.set_geometry_hints which accepts keyword arguments Monkey patch a keyword argument version of set_geometry_hints onto Gtk.Window. This version is compatible with pygtk and takes keywords instead of a Gdk.Geometry and Gdk.GeometryMask. https://bugzilla.gnome.org/show_bug.cgi?id=694067 pygtkcompat/pygtkcompat.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) commit 1ca0e142709843cdae9ca965dfa6cc292ef53ab5 Author: Martin Pitt Date: Tue Feb 26 10:09:47 2013 +0100 tests: Fix warning behaviour -Werror::* does not seem to do what it says on the tin, these options are ignored entirely apparently. Just keep -Wd to actually show all warnings including DeprecationWarning, which is hidden by default. tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit e7ea6952c7a2d8da68ed8b66770d889cd756df9a Author: Martin Pitt Date: Tue Feb 26 08:49:10 2013 +0100 Ship pygobject.doap for autogen.sh https://bugzilla.gnome.org/show_bug.cgi?id=694591 Makefile.am | 1 + 1 file changed, 1 insertion(+) commit 80ed803dab3ad914d7214a475e3c6ed743dfdccc Author: Simon Feltman Date: Tue Feb 19 03:07:19 2013 -0800 Fix crashes in various GObject signal handler functions Fix crashes in a large amount of signal handler functions exposed on the GObject module. This is possible now that the underlying GObject pointer is exposed to Python as a PyCapsule which marshaling can handle. The following functions in the GObject module have been verified: signal_handler_unblock signal_handler_disconnect signal_handler_is_connected signal_stop_emission signal_stop_emission_by_name signal_has_handler_pending signal_connect_closure signal_connect_closure_by_id signal_handler_find signal_handlers_destroy https://bugzilla.gnome.org/show_bug.cgi?id=633927 gi/_gobject/gobjectmodule.c | 57 ++-------------- gi/overrides/GObject.py | 158 ++++++++++++++++++++++++++++++++++---------- tests/test_signal.py | 121 ++++++++++++++++++++++++++++++++- 3 files changed, 247 insertions(+), 89 deletions(-) commit e9c578c1d47375cb2249ccdd86873faad04b89e1 Author: Olivier CrĂȘte Date: Fri Sep 14 21:29:53 2012 -0400 pygi-closure: Protect the GSList prepend with the GIL Signed-off-by: Simon Feltman https://bugzilla.gnome.org/show_bug.cgi?id=684060 gi/pygi-closure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) commit 6e0a32f6d9febbd782dc56a619974f009e79abd9 Author: Simon Feltman Date: Wed Feb 20 01:21:32 2013 -0800 generictreemodel: Fix bad default return type for get_column_type pygtkcompat/generictreemodel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) commit 8ec5c335e223bdf00c7bb6c9aac3e7ac7791e38e Author: Martin Pitt Date: Tue Feb 19 12:23:13 2013 +0100 configure.ac: post-release bump to 3.7.91 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)