I was using httplib to power my xml rpc script. I had problems when I wanted to use SSL and I got this error: File "/usr/lib/python2.5/httplib.py", line 1109, in recv return self._ssl.read(len) socket.sslerror: (8, 'EOF occurred in violation of protocol') I figured out this was because of poor error handling in python. May I suggest this as a fix to this bug: $ diff /usr/lib/python2.5/httplib.py /usr/lib/python2.5/httplib.py~ 1109,1112c1109 < try: < return self._ssl.read(len) < except socket.sslerror: < return ---
return self._ssl.read(len)
Just a note. I am by no means a python expert, just good enough to get my work done. I use Ubuntu gutsy. -- Thanks, Richie Ward
On 9/30/07, Richie Ward
I was using httplib to power my xml rpc script.
I had problems when I wanted to use SSL and I got this error: File "/usr/lib/python2.5/httplib.py", line 1109, in recv return self._ssl.read(len) socket.sslerror: (8, 'EOF occurred in violation of protocol')
I figured out this was because of poor error handling in python.
May I suggest this as a fix to this bug: $ diff /usr/lib/python2.5/httplib.py /usr/lib/python2.5/httplib.py~ 1109,1112c1109 < try: < return self._ssl.read(len) < except socket.sslerror: < return ---
return self._ssl.read(len)
Just a note. I am by no means a python expert, just good enough to get my work done. I use Ubuntu gutsy.
If you could, Richie, please open a bug report at bugs.python.org and attach your patch to it? That way it won't get lost and it can be attended to properly. -Brett
I believe this is already fixed in 2.6 with the new SSL code (I got the same error writing the unit tests and fixed it). Thanks for reporting it, though. Bill
participants (3)
-
Bill Janssen
-
Brett Cannon
-
Richie Ward