diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-04-01 16:05:20 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-04-01 16:05:20 +0000 |
commit | 14e876743dbe8e6b97bd6a02293eaaf7b7f9b444 (patch) | |
tree | 564af9858b17b8cf8102b21e04e38e106e04a3f0 | |
parent | 0dc1cddcacb6d7dcc766c8689dc95be68e005587 (diff) | |
download | pygobject-14e876743dbe8e6b97bd6a02293eaaf7b7f9b444.tar.gz |
Bug 334318 – gtk.AboutDialog crashes with 'authors' parameter as string instead of list
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | gobject/gobjectmodule.c | 8 |
2 files changed, 12 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2006-04-01 Gustavo J. A. M. Carneiro <gjc@gnome.org> + + * 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 <johan@gnome.org> * Makefile.am: Include dsextras.py in the dist and install it. diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 572d5315..80240774 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))) |