Merge lp:~barry/ubuntu/natty/pyopenssl/bug-758037 into lp:ubuntu/natty/pyopenssl

Proposed by Barry Warsaw
Status: Merged
Merge reported by: Barry Warsaw
Merged at revision: not available
Proposed branch: lp:~barry/ubuntu/natty/pyopenssl/bug-758037
Merge into: lp:ubuntu/natty/pyopenssl
Diff against target: 73 lines (+54/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/00list (+1/-0)
debian/patches/30_py27_memoryview.dpatch (+45/-0)
To merge this branch: bzr merge lp:~barry/ubuntu/natty/pyopenssl/bug-758037
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+57494@code.launchpad.net

Description of the change

This fixes bug 758037 using the patch given in upstream bug 686804. Tested using the recipe here: http://code.activestate.com/recipes/442473/

Verified to fix the bug in natty.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-12-22 09:39:55 +0000
3+++ debian/changelog 2011-04-13 13:57:29 +0000
4@@ -1,3 +1,11 @@
5+pyopenssl (0.10-1ubuntu3) natty; urgency=low
6+
7+ * Add upstream patch so that sendall() uses a memoryview, which is
8+ required for Python 2.7 compatibility. Patch given in upstream bug
9+ report <http://launchpad.net/bugs/686804>. (LP: #758037)
10+
11+ -- Barry Warsaw <barry@ubuntu.com> Wed, 13 Apr 2011 08:39:18 -0400
12+
13 pyopenssl (0.10-1ubuntu2) natty; urgency=low
14
15 * No-change rebuild to prefer python2.7.
16
17=== modified file 'debian/patches/00list'
18--- debian/patches/00list 2010-01-30 00:09:59 +0000
19+++ debian/patches/00list 2011-04-13 13:57:29 +0000
20@@ -1,2 +1,3 @@
21 10_fix_doc_buildsystem
22 20_spelling
23+30_py27_memoryview
24
25=== added file 'debian/patches/30_py27_memoryview.dpatch'
26--- debian/patches/30_py27_memoryview.dpatch 1970-01-01 00:00:00 +0000
27+++ debian/patches/30_py27_memoryview.dpatch 2011-04-13 13:57:29 +0000
28@@ -0,0 +1,45 @@
29+#! /bin/sh /usr/share/dpatch/dpatch-run
30+## 30_py27_memoryview.dpatch by Barry Warsaw <barry@ubuntu.com>
31+##
32+## All lines beginning with `## DP:' are a description of the patch.
33+## DP: Use memoryviews; required for Python 2.7
34+## DP: Upstream bug report: https://launchpad.net/bugs/686804
35+## DP: Closes https://launchpad.net/bugs/758037 (LP: #758037)
36+
37+@DPATCH@
38+
39+Index: pyOpenSSL-0.10/src/ssl/connection.c
40+===================================================================
41+--- pyOpenSSL-0.10.orig/src/ssl/connection.c
42++++ pyOpenSSL-0.10/src/ssl/connection.c
43+@@ -369,17 +369,20 @@ has been sent.\n\
44+ @param buf: The string to send\n\
45+ @param flags: (optional) Included for compatability with the socket\n\
46+ API, the value is ignored\n\
47+-@return: The number of bytes written\n\
48++@return: None\n\
49+ ";
50+ static PyObject *
51+ ssl_Connection_sendall(ssl_ConnectionObj *self, PyObject *args)
52+ {
53++ Py_buffer pbuf;
54+ char *buf;
55+ int len, ret, err, flags;
56+ PyObject *pyret = Py_None;
57+
58+- if (!PyArg_ParseTuple(args, "s#|i:sendall", &buf, &len, &flags))
59++ if (!PyArg_ParseTuple(args, "s*|i:sendall", &pbuf, &flags))
60+ return NULL;
61++ buf = pbuf.buf;
62++ len = pbuf.len;
63+
64+ do {
65+ MY_BEGIN_ALLOW_THREADS(self->tstate)
66+@@ -405,6 +408,7 @@ ssl_Connection_sendall(ssl_ConnectionObj
67+ break;
68+ }
69+ } while (len > 0);
70++ PyBuffer_Release(&pbuf);
71+
72+ Py_XINCREF(pyret);
73+ return pyret;

Subscribers

People subscribed via source and target branches

to all changes: