From 14e876743dbe8e6b97bd6a02293eaaf7b7f9b444 Mon Sep 17 00:00:00 2001 From: "Gustavo J. A. M. Carneiro" Date: Sat, 1 Apr 2006 16:05:20 +0000 Subject: Bug 334318 – gtk.AboutDialog crashes with 'authors' parameter as string instead of list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 7 +++++++ gobject/gobjectmodule.c | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b25868..cd0dc74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-04-01 Gustavo J. A. M. Carneiro + + * gobject/gobjectmodule.c (_pyg_strv_to_gvalue): Don't allow + arbitrary sequences, only tuple or list, since a string is a + sequence too. + (pyg_object_new): Add a bit more detail to the exception string. + 2006-01-16 Johan Dahlin * Makefile.am: Include dsextras.py in the dist and install it. diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 572d531..8024077 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -1721,8 +1721,8 @@ pyg_object_new (PyGObject *self, PyObject *args, PyObject *kwargs) if (pyg_param_gvalue_from_pyobject(¶ms[n_params].value, value, pspec) < 0) { PyErr_Format(PyExc_TypeError, - "could not convert value for property `%s'", - key_str); + "could not convert value for property `%s' from %s to %s", + key_str, value->ob_type->tp_name, g_type_name(G_PARAM_SPEC_VALUE_TYPE(pspec))); goto cleanup; } params[n_params].name = g_strdup(key_str); @@ -2682,7 +2682,9 @@ _pyg_strv_to_gvalue(GValue *value, PyObject *obj) int argc, i; gchar **argv; - if (!PySequence_Check(obj)) return -1; + if (!(PyTuple_Check(obj) || PyList_Check(obj))) + return -1; + argc = PySequence_Length(obj); for (i = 0; i < argc; ++i) if (!PyString_Check(PySequence_Fast_GET_ITEM(obj, i))) -- cgit