Description of problem: I get this traceback when attempting to serve content over SSL: ---------------------------------------- Exception happened during processing of request from ('192.168.122.1', 45544) Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/paste/httpserver.py", line 1068, in process_request_in_thread self.finish_request(request, client_address) File "/usr/lib64/python2.7/SocketServer.py", line 323, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib64/python2.7/SocketServer.py", line 641, in __init__ self.finish() File "/usr/lib64/python2.7/SocketServer.py", line 694, in finish self.wfile.flush() File "/usr/lib64/python2.7/socket.py", line 301, in flush self._sock.sendall(view[write_offset:write_offset+buffer_size]) TypeError: must be string or read-only buffer, not memoryview ---------------------------------------- If I comment out the ssl_pem config parameter, the content is served as expected. Version-Release number of selected component (if applicable): python-paste-1.7.4-7.fc14 Steps to Reproduce: set the "ssl_pem" config parameter in the [server:main] section of the application's ini file.
FWIW, "memoryview" objects are new in Python 2.7: http://docs.python.org/library/stdtypes.html#memoryview-type
Modules/socketmodule.:sock_sendall calls: if (!PyArg_ParseTuple(args, "s*|i:sendall", &pbuf, &flags)) This is what's emitting the: TypeError: must be string or read-only buffer, not memoryview message, within getargs.c:convertbuffer() This looks similar to this upstream problem: http://bugs.python.org/issue7133 though the fix for that is in the Python-2.7.tar.bz2 tarball in F14.
Re-assigning to Python
Tracked this down. It's an incompatibility between python-2.7's socket and pyOpenSSL. (The relevant code isn't actually in Modules/socketmodule.c. The self._sock that's getting used is from PyOpenSSL => OpenSSL.SSL.Connection This build seems to work for me: http://koji.fedoraproject.org/koji/taskinfo?taskID=2650286 I'll attach patch, reassign to pyOpenSSL and submit upstream.
Created attachment 467328 [details] Allow pyopenssl sendall to utilize a memoryview Allow pyopenssl sendall to utilize a memoryview
Paul, I've built new packages for F14 and rawhide. If you don't object, I'll push the F14 one to stable after a suitable time in testing. rmmcabe, when it comes out, please test the update to see if it works for you.
pyOpenSSL-0.9-3.fc14 has been submitted as an update for Fedora 14. https://admin.fedoraproject.org/updates/pyOpenSSL-0.9-3.fc14
pyOpenSSL-0.9-3.fc14 has been pushed to the Fedora 14 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update pyOpenSSL'. You can provide feedback for this update here: https://admin.fedoraproject.org/updates/pyOpenSSL-0.9-3.fc14
pyOpenSSL-0.9-3.fc14 has been pushed to the Fedora 14 stable repository. If problems still persist, please make note of it in this bug report.