diff --git a/python-cups-decoding.patch b/python-cups-decoding.patch new file mode 100644 index 0000000..54301ec --- /dev/null +++ b/python-cups-decoding.patch @@ -0,0 +1,14 @@ +diff -U0 pycups-1.9.63/ChangeLog.encoding pycups-1.9.63/ChangeLog +diff -up pycups-1.9.63/cupsconnection.c.encoding pycups-1.9.63/cupsconnection.c +--- pycups-1.9.63/cupsconnection.c.encoding 2013-04-12 11:35:20.604099365 +0100 ++++ pycups-1.9.63/cupsconnection.c 2013-04-12 11:35:34.945163243 +0100 +@@ -129,6 +129,9 @@ UTF8_from_PyObj (char **const utf8, PyOb + else if (PyString_Check (obj)) { + const char *ret; + PyObject *unicodeobj = PyUnicode_FromEncodedObject (obj, NULL, NULL); ++ if (unicodeobj == NULL) ++ return NULL; ++ + ret = UTF8_from_PyObj (utf8, unicodeobj); + Py_DECREF (unicodeobj); + return ret; diff --git a/python-cups.spec b/python-cups.spec index 48d3f90..6f8ff48 100644 --- a/python-cups.spec +++ b/python-cups.spec @@ -6,10 +6,11 @@ Summary: Python bindings for CUPS Name: python-cups Version: 1.9.63 -Release: 2%{?dist} +Release: 3%{?dist} URL: http://cyberelk.net/tim/software/pycups/ Source: http://cyberelk.net/tim/data/pycups/pycups-%{version}.tar.bz2 Patch1: python-cups-uris.patch +Patch2: python-cups-decoding.patch License: GPLv2+ Group: Development/Languages BuildRequires: cups-devel @@ -34,6 +35,9 @@ Documentation for python-cups. # Encode generated URIs correctly (patch from upstream) (bug #950162). %patch1 -p1 -b .uris +# Propagate UTF-8 decoding errors. +%patch2 -p1 -b .decoding + %build make CFLAGS="%{optflags} -fno-strict-aliasing" make doc @@ -52,6 +56,9 @@ make install DESTDIR="%{buildroot}" %doc examples html %changelog +* Fri Apr 12 2013 Tim Waugh - 1.9.63-3 +- Propagate UTF-8 decoding errors. + * Thu Apr 11 2013 Tim Waugh - 1.9.63-2 - Encode generated URIs correctly (bug #950162).