[vte] Add patch for python bindings. Fixes bug #556200

Kevin Fenzi kevin at fedoraproject.org
Sat Mar 10 16:03:58 UTC 2012


commit 665cfe02e72304cefaf07fcb0f9c60dddde6fce5
Author: Kevin Fenzi <kevin at scrye.com>
Date:   Sat Mar 10 09:03:55 2012 -0700

    Add patch for python bindings. Fixes bug #556200

 vte-python-bugfixes.patch |   86 +++++++++++++++++++++++++++++++++++++++++++++
 vte.spec                  |    9 ++++-
 2 files changed, 94 insertions(+), 1 deletions(-)
---
diff --git a/vte-python-bugfixes.patch b/vte-python-bugfixes.patch
new file mode 100644
index 0000000..691b350
--- /dev/null
+++ b/vte-python-bugfixes.patch
@@ -0,0 +1,86 @@
+diff -ur vte-0.22.5-orig/python/vte.override vte-0.22.5-python-get-text/python/vte.override
+--- vte-0.22.5-orig/python/vte.override	2010-01-16 20:54:40.515014436 -0500
++++ vte-0.22.5-python-get-text/python/vte.override	2010-01-16 22:14:40.881828300 -0500
+@@ -306,9 +306,9 @@
+     }
+ 
+     cb = PySequence_GetItem(data, 0); /* INCREFs */
+-    Py_XDECREF(cb);
+ 
+     if (!PyCallable_Check(cb)) {
++	    Py_XDECREF(cb);
+         PyErr_SetString(PyExc_TypeError, "callback is not a callable object");
+         return FALSE;
+     }
+@@ -320,6 +320,7 @@
+     PyTuple_SetItem(args, 3, PySequence_GetItem(data, 2));
+ 
+     result = PyObject_CallObject(cb, args);
++    Py_XDECREF(cb);
+     Py_DECREF(args);
+     
+     ret = (result && PyObject_IsTrue(result));
+@@ -332,7 +333,7 @@
+ build_attributes(GArray *attrs)
+ {
+     PyObject *py_attrs = PyTuple_New(attrs->len);
+-    int count;
++    guint count;
+     PyObject *row = PyString_FromString("row");
+     PyObject *column = PyString_FromString("column");
+     PyObject *fore = PyString_FromString("fore");
+@@ -344,6 +345,8 @@
+ 	VteCharAttributes *cht;
+ 	PyObject *py_char_attr;
+ 
++	cht = &g_array_index(attrs, VteCharAttributes, count);
++	
+ 	py_char_attr = Py_BuildValue("{S:l,S:l,S:N,S:N,S:I,S:I}",
+ 	                             row, cht->row,
+ 	                             column, cht->column,
+@@ -380,10 +383,9 @@
+     GArray *attrs = NULL;
+     char *text;
+     PyObject *py_attrs;
+-    int count;
+     long length;
+ 
+-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|OO:terminal_get_text",
++    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOO:terminal_get_text",
+ 				     kwlist, &callback, &do_attr, &data)) {
+         return NULL;
+     }
+@@ -451,10 +453,9 @@
+     GArray *attrs = NULL;
+     char *text;
+     PyObject *py_attrs;
+-    int count;
+     long length;
+ 
+-    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|OO:terminal_get_text_include_trailing_spaces",
++    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOO:terminal_get_text_include_trailing_spaces",
+ 				     kwlist, &callback, &do_attr, &data)) {
+         return NULL;
+     }
+@@ -522,11 +523,10 @@
+     GArray *attrs = NULL;
+     char *text;
+     PyObject *py_attrs;
+-    int count;
+     long length;
+ 
+     if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+-   				     "llllO|OO:terminal_get_text_range",
++   				     "llll|OOO:terminal_get_text_range",
+ 				     kwlist,
+ 				     &start_row, &start_col, &end_row, &end_col,
+ 				     &callback, &do_attr, &data)) {
+@@ -641,7 +641,7 @@
+     static char *kwlist[] = { "column", "row", NULL };
+     gchar *ret;
+     glong column, row;
+-    int *tag;
++    int tag;
+ 
+     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ll:VteTerminal.match_check", kwlist, &column, &row))
+         return NULL;
diff --git a/vte.spec b/vte.spec
index 57973aa..79d282a 100644
--- a/vte.spec
+++ b/vte.spec
@@ -4,7 +4,7 @@
 
 Name: vte
 Version: 0.28.2
-Release: 3%{?dist}
+Release: 4%{?dist}
 Summary: A terminal emulator
 License: LGPLv2+
 Group: User Interface/X
@@ -12,6 +12,9 @@ Group: User Interface/X
 Source: http://download.gnome.org/sources/vte/0.28/%{name}-%{version}.tar.xz
 # https://bugzilla.gnome.org/show_bug.cgi?id=663779
 Patch0: vte-alt-meta-confusion.patch
+# Python bindings bugfix
+# https://bugzilla.redhat.com/show_bug.cgi?id=556200
+Patch1: vte-python-bugfixes.patch
 
 BuildRequires: gtk2-devel >= %{gtk2_version}
 BuildRequires: pango-devel >= %{pango_version}
@@ -46,6 +49,7 @@ vte.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 PYTHON=%{_bindir}/python`%{__python} -c "import sys ; print sys.version[:3]"`
@@ -97,6 +101,9 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/python*/site-packages/gtk-2.0/*.a
 %doc %{_datadir}/gtk-doc/html/vte-0.0
 
 %changelog
+* Sat Mar 10 2012 Kevin Fenzi <kevin at scrye.com> - 0.28.2-4
+- Add patch for python bindings. Fixes bug #556200
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.28.2-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list