diff -u pyopenssl-0.10/debian/changelog pyopenssl-0.10/debian/changelog --- pyopenssl-0.10/debian/changelog +++ pyopenssl-0.10/debian/changelog @@ -1,3 +1,11 @@ +pyopenssl (0.10-1ubuntu3) natty; urgency=low + + * Add upstream patch so that sendall() uses a memoryview, which is + required for Python 2.7 compatibility. Patch given in upstream bug + report . (LP: #758037) + + -- Barry Warsaw Wed, 13 Apr 2011 08:39:18 -0400 + pyopenssl (0.10-1ubuntu2) natty; urgency=low * No-change rebuild to prefer python2.7. diff -u pyopenssl-0.10/debian/patches/00list pyopenssl-0.10/debian/patches/00list --- pyopenssl-0.10/debian/patches/00list +++ pyopenssl-0.10/debian/patches/00list @@ -2,0 +3 @@ +30_py27_memoryview only in patch2: unchanged: --- pyopenssl-0.10.orig/debian/patches/30_py27_memoryview.dpatch +++ pyopenssl-0.10/debian/patches/30_py27_memoryview.dpatch @@ -0,0 +1,45 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_py27_memoryview.dpatch by Barry Warsaw +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Use memoryviews; required for Python 2.7 +## DP: Upstream bug report: https://launchpad.net/bugs/686804 +## DP: Closes https://launchpad.net/bugs/758037 (LP: #758037) + +@DPATCH@ + +Index: pyOpenSSL-0.10/src/ssl/connection.c +=================================================================== +--- pyOpenSSL-0.10.orig/src/ssl/connection.c ++++ pyOpenSSL-0.10/src/ssl/connection.c +@@ -369,17 +369,20 @@ has been sent.\n\ + @param buf: The string to send\n\ + @param flags: (optional) Included for compatability with the socket\n\ + API, the value is ignored\n\ +-@return: The number of bytes written\n\ ++@return: None\n\ + "; + static PyObject * + ssl_Connection_sendall(ssl_ConnectionObj *self, PyObject *args) + { ++ Py_buffer pbuf; + char *buf; + int len, ret, err, flags; + PyObject *pyret = Py_None; + +- if (!PyArg_ParseTuple(args, "s#|i:sendall", &buf, &len, &flags)) ++ if (!PyArg_ParseTuple(args, "s*|i:sendall", &pbuf, &flags)) + return NULL; ++ buf = pbuf.buf; ++ len = pbuf.len; + + do { + MY_BEGIN_ALLOW_THREADS(self->tstate) +@@ -405,6 +408,7 @@ ssl_Connection_sendall(ssl_ConnectionObj + break; + } + } while (len > 0); ++ PyBuffer_Release(&pbuf); + + Py_XINCREF(pyret); + return pyret;