1 Oct 2007 01:11
OpenSSL httplib bug
Richie Ward <richies <at> gmail.com>
2007-09-30 23:11:11 GMT
2007-09-30 23:11:11 GMT
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
_______________________________________________
Python-Dev mailing list
Python-Dev <at> python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org
(Continue reading)
If you define passing a string to/from any .NET function
as I/O, I suppose that's true, but it's not what people
normally mean by the term.
> the REASON it causes trouble is the inconsistency
> in the basic C/Unix/Python text I/O model. Let's consider just
> \f, \r and \n,
But we're not talking about \f or anything else here, only
newlines. I've never heard anyone complain about getting
confused over the handling of \f in Python. That may be
because nobody uses \f for anything these days, but whatever
the reason, it seems to be a non-issue.
In any case, it still doesn't mean that you "don't get
and I'm not so sure it would be all that useful.
Yes, despite being the one who suggested it, I've come to
the same conclusion myself. The problem should really be
addressed at the source, which is the Python/.NET boundary.
Anything else would just lead to ambiguity.
So I'm voting -1 on my own proposal here.
RSS Feed