Open GoogleCodeExporter opened 8 years ago
After some investigation
The problem is inside http:ResponseBody::close
the test below leads to an infinite loop
while not self.resp.isclosed():
self.resp.read(CHUNK_SIZE)
the httplib documentations says:
def isclosed(self):
# NOTE: it is possible that we will not ever call self.close(). This
# case occurs when will_close is TRUE, length is None, and we
# read up to the last byte, but NOT past it.
#
# IMPLIES: if will_close is FALSE, then self.close() will ALWAYS be
# called, meaning self.isclosed() is meaningful.
return self.fp is None
AppEngine uses a custome version of httplib.
I dont know its behavior. But it returns True with the standard httplib and
False on app engine (and makes an infinite loop)
Original comment by alexan...@codjovi.fr
on 20 May 2013 at 9:55
here my fix
def close(self):
while not self.resp.isclosed():
chunk = self.resp.read(CHUNK_SIZE)
if len(chunk) == 0:
self.resp.close()
if self.callback:
self.callback()
self.callback = None
Original comment by alexan...@codjovi.fr
on 20 May 2013 at 10:27
This issue has been migrated to GitHub. Please continue discussion here:
https://github.com/djc/couchdb-python/issues/224
Original comment by djc.ochtman
on 15 Jul 2014 at 7:22
Original issue reported on code.google.com by
alexan...@codjovi.fr
on 20 May 2013 at 7:11