Issue 224 in couchdb-python: Database.view() and list() don't work on Google's AppEngine

9 views
Skip to first unread message

couchdb...@googlecode.com

unread,
May 20, 2013, 3:11:53 PM5/20/13
to couchdb...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 224 by alexan...@codjovi.fr: Database.view() and list() don't
work on Google's AppEngine
http://code.google.com/p/couchdb-python/issues/detail?id=224

What steps will reproduce the problem?
1. setup a python appengine env
2. use the list() or view() functions
3.

What is the expected output? What do you see instead?
The script get stuck on list() (or when you want iterate the result of
view())

I think it is getting stuck on conn.getresponse() in http._try_request()

What version of the product are you using? On what operating system?
0.9

Please provide any additional information below.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

couchdb...@googlecode.com

unread,
May 20, 2013, 5:56:01 PM5/20/13
to couchdb...@googlegroups.com

Comment #1 on issue 224 by alexan...@codjovi.fr: Database.view() and list()
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)

couchdb...@googlecode.com

unread,
May 20, 2013, 6:27:54 PM5/20/13
to couchdb...@googlegroups.com

Comment #2 on issue 224 by alexan...@codjovi.fr: Database.view() and list()
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

couchdb...@googlecode.com

unread,
Jul 15, 2014, 3:48:02 AM7/15/14
to couchdb...@googlegroups.com

Comment #3 on issue 224 by djc.ochtman: Database.view() and list() don't
This issue has been migrated to GitHub. Please continue discussion here:

https://github.com/djc/couchdb-python/issues/224
Reply all
Reply to author
Forward
0 new messages