Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 204 by d...@playcanvas.com: KeyError when resolving conflicts
http://code.google.com/p/couchdb-python/issues/detail?id=204
What steps will reproduce the problem?
1. Run the attached script couch.py
What is the expected output? What do you see instead?
I expect to see conflicts resolved resulting in doc with value=10
Instead I get KeyError: 'http://localhost:5984/keyerror_test/test'
from:
/couchdb/http.py", line 251, in request
del self.cache[url]
What version of the product are you using? On what operating system?
couchdb-python 0.8, python 2.7, Ubuntu 11.04
Please provide any additional information below.
I can fix this issue by changing lint 251 of http.py to
try:
del self.cache[url]
except KeyError, e:
pass
I guess this is a threading issue as self.cache has been altered between
line 165 and line 251. Is it even valid to use couchdb-python in this way?
Note, I originally discovered this in my Pylons web app when I would get
this exception during a Mapping.load(db, id) call.
Attachments:
couch.py 585 bytes