Hello community,

here is the log from the commit of package python-gobject for openSUSE:Factory
checked in at Mon Oct 3 09:25:02 CEST 2011.



--------
--- openSUSE:Factory/python-gobject/python-gobject.changes      2011-10-02 
10:26:24.000000000 +0200
+++ python-gobject/python-gobject.changes       2011-10-01 19:07:18.000000000 
+0200
@@ -1,0 +2,9 @@
+Sat Oct  1 19:01:15 CEST 2011 - [email protected]
+
+- Update to version 3.0.1:
+  + when checking instances union members are same type as parent
+  + add a floating flag to pygobjects
+  + Revert "Fix refcount bug by not creating python wrapper during
+    gobject init stage"
+
+-------------------------------------------------------------------
python3-gobject.changes: same change

calling whatdependson for head-i586


Old:
----
  pygobject-3.0.0.tar.bz2

New:
----
  pygobject-3.0.1.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-gobject.spec ++++++
--- /var/tmp/diff_new_pack.PQPEQ7/_old  2011-10-03 09:24:58.000000000 +0200
+++ /var/tmp/diff_new_pack.PQPEQ7/_new  2011-10-03 09:24:58.000000000 +0200
@@ -34,7 +34,7 @@
 Name:           python-gobject
 %define _name   pygobject
 Summary:        Python bindings for GObject
-Version:        3.0.0
+Version:        3.0.1
 Release:        1
 License:        LGPLv2.1+
 Group:          Development/Libraries/Python

python3-gobject.spec: same change
++++++ pygobject-3.0.0.tar.bz2 -> pygobject-3.0.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/ChangeLog 
new/pygobject-3.0.1/ChangeLog
--- old/pygobject-3.0.0/ChangeLog       2011-09-19 19:21:04.000000000 +0200
+++ new/pygobject-3.0.1/ChangeLog       2011-09-30 20:19:40.000000000 +0200
@@ -1,3 +1,57 @@
+commit 56ac9339eb1d6950623dc4d8c3b9972874e7fa86
+Author: John (J5) Palmieri <[email protected]>
+Date:   Thu Sep 22 19:03:20 2011 -0400
+
+    when checking instances union members are same type as parent
+
+    * this is so we can support sending Gdk.Event members in place of
+      the Event union into methods
+    * we only support this if the union member has a type of GI_INTERFACE
+    for now
+
+    https://bugzilla.gnome.org/show_bug.cgi?id=659879
+
+ gi/pygi-marshal-from-py.c |   60
+ ++++++++++++++++++++++++++++++++++++++++++---
+ 1 files changed, 56 insertions(+), 4 deletions(-)
+
+commit 311a4f8035a95b41bc3c0a836c32b7a5bf2d9959
+Author: John (J5) Palmieri <[email protected]>
+Date:   Wed Sep 21 21:50:48 2011 -0400
+
+    add a floating flag to pygobjects
+
+    * this allows us to correctly refcount when custom gobjects are
+    instantiated
+      via g_object_new
+
+ gi/_gobject/gobjectmodule.c     |    5 +++++
+ gi/_gobject/pygobject-private.h |    3 +++
+ gi/_gobject/pygobject.c         |   27 ++++++++++++++++++++++++++-
+ gi/_gobject/pygobject.h         |    3 ++-
+ 4 files changed, 36 insertions(+), 2 deletions(-)
+
+commit d2d29ae5845217254b9336fd8629f369cb119b25
+Author: John (J5) Palmieri <[email protected]>
+Date:   Wed Sep 21 21:13:22 2011 -0400
+
+    Revert "Fix refcount bug by not creating python wrapper during
+    gobject init stage"
+
+    This reverts commit f6fa5dd8f39af1b8a52d7600d257400b0983e8c5.
+
+ gi/_gobject/gobjectmodule.c |   32 +++++++++++++++++---------------
+ 1 files changed, 17 insertions(+), 15 deletions(-)
+
+commit a24c10b779f2a1b0425d56d03d59c393389cad98
+Author: John (J5) Palmieri <[email protected]>
+Date:   Wed Sep 21 21:10:00 2011 -0400
+
+    make sure to commit the NEWS file
+
+ NEWS |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
 commit 2eed2940c9be099fb6305288d895265e6b35d3d2
 Author: John (J5) Palmieri <[email protected]>
 Date:   Mon Sep 19 13:19:57 2011 -0400
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/NEWS new/pygobject-3.0.1/NEWS
--- old/pygobject-3.0.0/NEWS    2011-09-19 19:19:47.000000000 +0200
+++ new/pygobject-3.0.1/NEWS    2011-09-30 19:43:29.000000000 +0200
@@ -1,3 +1,8 @@
+3.0.1   30-Sep-2011
+       - when checking instances union members are same type as parent
+       - add a floating flag to pygobjects
+       - Revert "Fix refcount bug by not creating python wrapper during 
gobject init stage"
+
 3.0.0   19-Sep-2011
         - up version required of gobject-introspection to 1.29.0 (John (J5) 
Palmieri)
         - fix most warnings (John (J5) Palmieri)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/PKG-INFO new/pygobject-3.0.1/PKG-INFO
--- old/pygobject-3.0.0/PKG-INFO        2011-09-19 19:20:47.000000000 +0200
+++ new/pygobject-3.0.1/PKG-INFO        2011-09-30 19:44:23.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: PyGObject
-Version: 3.0.0
+Version: 3.0.1
 Summary: Python bindings for GObject
 Home-page: http://www.pygtk.org/
 Author: James Henstridge
@@ -8,7 +8,7 @@
 Maintainer: Johan Dahlin
 Maintainer-email: [email protected]
 License: GNU LGPL
-Download-url: 
ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.0/pygobject-3.0.0.tar.gz
+Download-url: 
ftp://ftp.gnome.org/pub/GNOME/sources/pygobject/3.0/pygobject-3.0.1.tar.gz
 Description: Python bindings for GLib and GObject
 Platform: POSIX, Windows
 Classifier: Development Status :: 5 - Production/Stable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/configure 
new/pygobject-3.0.1/configure
--- old/pygobject-3.0.0/configure       2011-09-19 19:20:39.000000000 +0200
+++ new/pygobject-3.0.1/configure       2011-09-30 19:44:15.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for pygobject 3.0.0.
+# Generated by GNU Autoconf 2.68 for pygobject 3.0.1.
 #
 # Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject>.
 #
@@ -571,8 +571,8 @@
 # Identity of this package.
 PACKAGE_NAME='pygobject'
 PACKAGE_TARNAME='pygobject'
-PACKAGE_VERSION='3.0.0'
-PACKAGE_STRING='pygobject 3.0.0'
+PACKAGE_VERSION='3.0.1'
+PACKAGE_STRING='pygobject 3.0.1'
 PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject'
 PACKAGE_URL=''
 
@@ -1358,7 +1358,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures pygobject 3.0.0 to adapt to many kinds of systems.
+\`configure' configures pygobject 3.0.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1428,7 +1428,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of pygobject 3.0.0:";;
+     short | recursive ) echo "Configuration of pygobject 3.0.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1553,7 +1553,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-pygobject configure 3.0.0
+pygobject configure 3.0.1
 generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1831,7 +1831,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by pygobject $as_me 3.0.0, which was
+It was created by pygobject $as_me 3.0.1, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
@@ -2195,9 +2195,9 @@
 PYGOBJECT_MINOR_VERSION=0
 
 
-$as_echo "#define PYGOBJECT_MICRO_VERSION 0" >>confdefs.h
+$as_echo "#define PYGOBJECT_MICRO_VERSION 1" >>confdefs.h
 
-PYGOBJECT_MICRO_VERSION=0
+PYGOBJECT_MICRO_VERSION=1
 
 
 ac_config_headers="$ac_config_headers config.h"
@@ -2681,7 +2681,7 @@
 
 # Define the identity of the package.
  PACKAGE='pygobject'
- VERSION='3.0.0'
+ VERSION='3.0.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -12017,7 +12017,7 @@
 Report bugs to <[email protected]>."
 
 lt_cl_version="\
-pygobject config.lt 3.0.0
+pygobject config.lt 3.0.1
 configured by $0, generated by GNU Autoconf 2.68.
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -16723,7 +16723,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by pygobject $as_me 3.0.0, which was
+This file was extended by pygobject $as_me 3.0.1, which was
 generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16789,7 +16789,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-pygobject config.status 3.0.0
+pygobject config.status 3.0.1
 configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/configure.ac 
new/pygobject-3.0.1/configure.ac
--- old/pygobject-3.0.0/configure.ac    2011-09-19 19:16:20.000000000 +0200
+++ new/pygobject-3.0.1/configure.ac    2011-09-30 19:42:02.000000000 +0200
@@ -12,7 +12,7 @@
 dnl the pygobject version number
 m4_define(pygobject_major_version, 3)
 m4_define(pygobject_minor_version, 0)
-m4_define(pygobject_micro_version, 0)
+m4_define(pygobject_micro_version, 1)
 m4_define(pygobject_version, 
pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
 
 dnl versions of packages we require ...
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/gi/_gobject/gobjectmodule.c 
new/pygobject-3.0.1/gi/_gobject/gobjectmodule.c
--- old/pygobject-3.0.0/gi/_gobject/gobjectmodule.c     2011-09-15 
21:56:00.000000000 +0200
+++ new/pygobject-3.0.1/gi/_gobject/gobjectmodule.c     2011-09-22 
17:52:29.000000000 +0200
@@ -1048,7 +1048,7 @@
                            gpointer         g_class)
 {
     GObject *object = (GObject *) instance;
-    PyObject *wrapper;
+    PyObject *wrapper, *args, *kwargs;
 
     wrapper = g_object_get_qdata(object, pygobject_wrapper_key);
     if (wrapper == NULL) {
@@ -1059,6 +1059,27 @@
         }
     }
     pygobject_init_wrapper_set(NULL);
+    if (wrapper == NULL) {
+          /* this looks like a python object created through
+           * g_object_new -> we have no python wrapper, so create it
+           * now */
+        PyGILState_STATE state;
+        state = pyglib_gil_state_ensure();
+        wrapper = pygobject_new_full(object, FALSE, g_class);
+
+        /* float the wrapper ref here because we are going to orphan it
+         * so we don't destroy the wrapper. The next call to pygobject_new_full
+         * will take the ref */
+        pygobject_ref_float (wrapper);
+        args = PyTuple_New(0);
+        kwargs = PyDict_New();
+        if (Py_TYPE(wrapper)->tp_init(wrapper, args, kwargs))
+            PyErr_Print();
+
+        Py_DECREF(args);
+        Py_DECREF(kwargs);
+        pyglib_gil_state_release(state);
+    }
 }
 
 
@@ -1730,22 +1751,8 @@
     g_type_class_unref(class);
 
     if (obj) {
-        PyObject *empty_args;
-        PyObject *empty_kwargs;
-        PyGILState_STATE state;
-
         pygobject_sink (obj);
        self = (PyGObject *) pygobject_new_full((GObject *)obj, FALSE, NULL);
-        empty_args = PyTuple_New(0);
-        empty_kwargs = PyDict_New();
-
-        state = pyglib_gil_state_ensure();
-        if (Py_TYPE(self)->tp_init((PyObject *)self, empty_args, empty_kwargs))
-            PyErr_Print();
-        pyglib_gil_state_release(state);
-
-        Py_DECREF(empty_args);
-        Py_DECREF(empty_kwargs);
         g_object_unref(obj);
     } else
         self = NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/gi/_gobject/pygobject-private.h 
new/pygobject-3.0.1/gi/_gobject/pygobject-private.h
--- old/pygobject-3.0.0/gi/_gobject/pygobject-private.h 2011-09-13 
22:19:29.000000000 +0200
+++ new/pygobject-3.0.1/gi/_gobject/pygobject-private.h 2011-09-22 
17:52:29.000000000 +0200
@@ -96,6 +96,9 @@
 
 gboolean pyg_gerror_exception_check(GError **error);
 
+void pygobject_ref_float(PyGObject *self);
+void pygobject_ref_sink(PyGObject *self);
+
 /* from pygtype.h */
 extern PyTypeObject PyGTypeWrapper_Type;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/gi/_gobject/pygobject.c 
new/pygobject-3.0.1/gi/_gobject/pygobject.c
--- old/pygobject-3.0.0/gi/_gobject/pygobject.c 2011-09-13 22:39:48.000000000 
+0200
+++ new/pygobject-3.0.1/gi/_gobject/pygobject.c 2011-09-22 17:52:29.000000000 
+0200
@@ -560,6 +560,31 @@
     g_object_unref(self->obj);
 }
 
+/* Called when an custom gobject is initalized via g_object_new instead of
+   its constructor.  The next time the wrapper is access via 
+   pygobject_new_full it will sink the floating reference instead of
+   adding a new reference and causing a leak */
+ 
+void
+pygobject_ref_float(PyGObject *self)
+{
+    /* should only be floated once */
+    g_assert(!(self->private_flags.flags & PYGOBJECT_IS_FLOATING_REF));
+    
+    self->private_flags.flags |= PYGOBJECT_IS_FLOATING_REF;
+}
+
+/* Called by gobject_new_full, if the floating flag is set remove it, otherwise
+   ref the pyobject */
+void
+pygobject_ref_sink(PyGObject *self)
+{
+    if (self->private_flags.flags & PYGOBJECT_IS_FLOATING_REF)
+        self->private_flags.flags &= ~PYGOBJECT_IS_FLOATING_REF;
+    else
+        Py_INCREF ( (PyObject *) self);
+}
+
 /**
  * pygobject_register_wrapper:
  * @self: the wrapper instance
@@ -888,7 +913,7 @@
     /* we already have a wrapper for this object -- return it. */
     self = (PyGObject *)g_object_get_qdata(obj, pygobject_wrapper_key);
     if (self != NULL) {
-       Py_INCREF(self);
+       pygobject_ref_sink(self);
     } else {
        /* create wrapper */
         PyGObjectData *inst_data = pyg_object_peek_inst_data(obj);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/gi/_gobject/pygobject.h 
new/pygobject-3.0.1/gi/_gobject/pygobject.h
--- old/pygobject-3.0.0/gi/_gobject/pygobject.h 2011-09-15 21:56:00.000000000 
+0200
+++ new/pygobject-3.0.1/gi/_gobject/pygobject.h 2011-09-22 17:52:29.000000000 
+0200
@@ -23,7 +23,8 @@
 };
 
 typedef enum {
-    PYGOBJECT_USING_TOGGLE_REF = 1 << 0
+    PYGOBJECT_USING_TOGGLE_REF = 1 << 0,
+    PYGOBJECT_IS_FLOATING_REF = 1 << 1
 } PyGObjectFlags;
 
   /* closures is just an alias for what is found in the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pygobject-3.0.0/gi/pygi-marshal-from-py.c 
new/pygobject-3.0.1/gi/pygi-marshal-from-py.c
--- old/pygobject-3.0.0/gi/pygi-marshal-from-py.c       2011-09-16 
05:41:26.000000000 +0200
+++ new/pygobject-3.0.1/gi/pygi-marshal-from-py.c       2011-09-30 
19:39:51.000000000 +0200
@@ -1416,10 +1416,62 @@
             GType type = iface_cache->g_type;
 
             if (!PyObject_IsInstance (py_arg, iface_cache->py_type)) {
-                PyErr_Format (PyExc_TypeError, "Expected a %s, but got %s",
-                              iface_cache->type_name,
-                              py_arg->ob_type->tp_name);
-                return FALSE;
+                /* wait, we might be a member of a union so manually check */
+                if (info_type == GI_INFO_TYPE_UNION) {
+                    gint i;
+                    gint n_fields;
+                    gboolean is_member = FALSE;
+                    GIUnionInfo *union_info = (GIUnionInfo *) 
iface_cache->interface_info;
+
+                    n_fields = g_union_info_get_n_fields (union_info);
+
+                    for (i = 0; i < n_fields; i++) {
+                        GIFieldInfo *field_info;
+                        GITypeInfo *field_type_info;
+
+                        field_info = g_union_info_get_field (union_info, i);
+                        field_type_info = g_field_info_get_type (field_info);
+
+                        /* we can only check if the members are interfaces */
+                        if (g_type_info_get_tag (field_type_info) ==
+                            GI_TYPE_TAG_INTERFACE) {
+                            PyObject *py_type;
+                            GIInterfaceInfo *field_iface_info =
+                                g_type_info_get_interface(field_type_info);
+
+                            py_type = _pygi_type_import_by_gi_info (
+                                (GIBaseInfo *) field_iface_info);
+
+                            if (PyObject_IsInstance (py_arg, py_type)) {
+                                is_member = TRUE;
+                                break;
+                            }
+
+                            Py_XDECREF (py_type);
+                            g_base_info_unref ( ( GIBaseInfo *) 
field_iface_info);
+
+                        }
+
+                        g_base_info_unref ( ( GIBaseInfo *) field_type_info);
+                        g_base_info_unref ( ( GIBaseInfo *) field_info);
+
+                        if (is_member)
+                            break;
+                    }
+
+                    if (!is_member) {
+                        PyErr_Format (PyExc_TypeError,
+                                      "Expected a %s, but got %s",
+                                      iface_cache->type_name,
+                                      py_arg->ob_type->tp_name);
+                        return FALSE;
+                    }
+                } else {
+                    PyErr_Format (PyExc_TypeError, "Expected a %s, but got %s",
+                                  iface_cache->type_name,
+                                  py_arg->ob_type->tp_name);
+                    return FALSE;
+                }
             }
 
             if (g_type_is_a (type, G_TYPE_BOXED)) {

continue with "q"...



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to