New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssertionErrors in httplib #37758
Comments
I've recently noticed AssertionErrors being raised by Traceback (most recent call last):
File "qa.py", line 22, in ?
x = s.query(tmpl, st, en, radius, age)
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 985, in __call__
return self.__send(self.__name, args)
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 1269, in __request
verbose=self.__verbose
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 1036, in request
return self._parse_response(h.getfile(), sock)
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 1165, in _parse_response
response = file.read(1024)
File "/Users/skip/local/lib/python2.3/httplib.py", line 1150, in read
assert not self._line_consumed and self._line_left
AssertionError I don't see a problem with raising an exception in this situation. I just |
Logged In: YES It's definitely the case that an AssertionError shouldn't be Also, do you know when the server is sending an HTTP/0.9 |
Logged In: YES Any more info Skip? |
Logged In: YES No, sorry, I haven't looked more deeply into the problem. I did investigate S |
Logged In: YES Sorry for the delay on this. I think I'm closing in on the Maybe it's worth adding a test for line == "" after the line = self.fp.readline()
if self.debuglevel > 0:
print "reply:", repr(line)
if line == "":
raise BadStatusLine(line) That would distinguish an error reading from an 0.9 server |
Logged In: YES We can provoke this error by setting a very small timeout, |
Logged In: YES [small timeout?] Not since the changes to the makefile() changes to socket.py (or at least >>> socket.setdefaulttimeout(0.05)
>>> manatee = xmlrpclib.ServerProxy("http://manatee.mojam.com:5007")
>>> manatee.noop()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 1021, in __call__
return self.__send(self.__name, args)
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 1308, in __request
verbose=self.__verbose
File "/Users/skip/local/lib/python2.3/xmlrpclib.py", line 1056, in request
errcode, errmsg, headers = h.getreply()
File "/Users/skip/local/lib/python2.3/httplib.py", line 1019, in getreply
response = self._conn.getresponse()
File "/Users/skip/local/lib/python2.3/httplib.py", line 770, in getresponse
response.begin()
File "/Users/skip/local/lib/python2.3/httplib.py", line 268, in begin
version, status, reason = self._read_status()
File "/Users/skip/local/lib/python2.3/httplib.py", line 230, in _read_status
line = self.fp.readline()
File "/Users/skip/local/lib/python2.3/socket.py", line 321, in readline
data = recv(1)
socket.error: (35, 'Resource temporarily unavailable') I think you may still get the assertion error if the timeout is sufficient to I suspect we're better off just closing this with either "postponed" or |
Logged In: YES OK, I saw this problem pretty in several programs (mine or It is pretty obvious when the assert happens, we have a empty A suggusted fix is to append 'and len(self._line) != 0' to 0 Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.2/threading.py", line 414, in
__bootstrap
self.run()
File "/usr/lib/python2.2/threading.py", line 402, in run
apply(self.__target, self.__args, self.__kwargs)
File
"/usr/lib/python2.2/site-packages/BitTorrent/Rerequester.py",
line 76, in rer
equest
r = h.read()
File "/usr/lib/python2.2/httplib.py", line 1148, in read
assert not self._line_consumed and self._line_left
AssertionError |
Logged In: YES Thanks for the comment, showme1949. It's obvious that the |
Logged In: YES I had this problem going against a Novell iChains reverse proxy SSL_CTX_set_options(self->ctx, I added this after the SSL_CTX_set_verify call in the SSL_CTX_set_options(conn->ssl.ctx, SSL_OP_ALL); |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: