djc / couchdb-python

Python library for working with CouchDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problem iterating over Rows of viewResults

jmrosal opened this issue · comments

I am using couchDB 0.10 on ubuntu 14.04 machine with python 3.4.

When trying to use viewResults.rows as list_interator for the first time, python throws the following complaint:

/home/jmrosal/.virtualenvs/DataInput/lib/python3.4/site-packages/couchdb/http.py in _try_request_with_retries(retries)
316 p raise
317 try:
--> 318 delay = retries.next()
319 except StopIteration:
320 # No more retries, raise last socket error.

AttributeError: 'list_iterator' object has no attribute 'next'

It seesm that to comply with python 3.x, the code should be:

316 p raise
317 try:
--> 318 delay = next(retries)
319 except StopIteration:
320 # No more retries, raise last socket error.

Can anyone confirm that?

Cheers

That sounds plausible. Could you write a sort of minimal test case?

Ah, it looks like this has already been fixed in 7d50b47. Could you try with master?

I've done the change in the code myself and so far so good. I will keep you posted.

Cheers.

Thanks, I'll close this for now. Feel free to reopen if the problem persists/comes back.