Issue 204 in couchdb-python: KeyError when resolving conflicts

24 views
Skip to first unread message

couchdb...@googlecode.com

unread,
Nov 16, 2011, 10:19:44 AM11/16/11
to couchdb...@googlegroups.com
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

couchdb...@googlecode.com

unread,
Nov 16, 2011, 12:44:12 PM11/16/11
to couchdb...@googlegroups.com

Comment #1 on issue 204 by matt.goo...@gmail.com: KeyError when resolving
conflicts
http://code.google.com/p/couchdb-python/issues/detail?id=204

couchdb.http.Session does attempt to be thread-safe so I'd definitely say
you're using it just fine and this is a bug. Thanks for reporting!

couchdb...@googlecode.com

unread,
Sep 21, 2012, 4:32:25 AM9/21/12
to couchdb...@googlegroups.com
Updates:
Owner: kxepal

Comment #2 on issue 204 by djc.ochtman: KeyError when resolving conflicts
http://code.google.com/p/couchdb-python/issues/detail?id=204

(No comment was entered for this change.)

couchdb...@googlecode.com

unread,
Sep 21, 2012, 8:46:28 PM9/21/12
to couchdb...@googlegroups.com
Updates:
Labels: Milestone-0.9

Comment #3 on issue 204 by wickedg...@gmail.com: KeyError when resolving

couchdb...@googlecode.com

unread,
Oct 5, 2012, 4:31:38 PM10/5/12
to couchdb...@googlegroups.com
Updates:
Status: Fixed

Comment #4 on issue 204 by kxepal: KeyError when resolving conflicts
http://code.google.com/p/couchdb-python/issues/detail?id=204

Fixed in r4c4d3ecf896b

Reply all
Reply to author
Forward
0 new messages