Closed GoogleCodeExporter closed 8 years ago
This is almost certainly the same as issue 85. Please can you test with the
latest
httplib2 from their source repository.
Original comment by matt.goo...@gmail.com
on 1 Dec 2009 at 5:14
Yes.. I took the hg clone of the latest trunk.. It gave the same error. Could
you
please check the repro on your system as well..
Thanks and regards
Tarun Pasrija
Original comment by tarun.pa...@gmail.com
on 1 Dec 2009 at 6:17
Tarun, are you deleting the database before each time you run your script?
Original comment by matt.goo...@gmail.com
on 1 Dec 2009 at 6:59
Hi Matt
This script does the job of creating a database and then putting a document in
it. So
I am handling both the cases using try, catch if the database already exists.
But in
both the cases even if the database does not exist it still throws this error. I
would request you to just copy paste this code as is and try this out on
couchDB.
Thanks and Regards
Tarun Pasrija
Original comment by tarun.pa...@gmail.com
on 2 Dec 2009 at 7:15
OK, I think this is just a misunderstanding of how CouchDB works.
You cannot modify an existing document without providing the document's current
_rev. The 2nd time your script runs you're updating an existing document but
there's no _rev
at all.
"db[self.couchdocName] = {...}" just results in a HTTP PUT, so see
http://wiki.apache.org/couchdb/HTTP_Document_API#PUT for more information.
Original comment by matt.goo...@gmail.com
on 2 Dec 2009 at 9:17
Yes, I do understand that I cannot modify. The problem I specified is by
running the
script just once when the document ID specified does not exist. Would it be
possible
to try and run the script once and see it. I believe I would then not have
logical
conclusions as one reason or the other.
Its as simple as testing the sample code in the client.py
for doc in db.update([
... Document(type='Person', name='John Doe'),
... Document(type='Person', name='Mary Jane'),
... Document(type='City', name='Gotham City')
... ]):
If you check the CouchDB Admin. There would be 6 entries instead of 3.
Thanks and Regards
Tarun Pasrija
Original comment by tarun.pa...@gmail.com
on 2 Dec 2009 at 10:36
I'm fairly confident that the "6 entries instead of 3" problem is due to the
known
httplib2 problem documented in issue 85.
I have run the script and that's when I realised that the database and document
are not
necessarily being deleted before each test run. For clarity, here are my test
findings:
1. httplib2 0.5.0, no database -- ResourceConflict
2. httplib2 from hg, no database -- no error
3. httplib2 from hg, existing database and document -- ResourceConflict
Please could you check again. If you're still having problems then post back
here with
the exact script you're using (the one you posted doesn't actually run ;-)) and
the
versions of CouchDB, couchdb-python, httplib2 and Python.
Thanks, Matt.
Original comment by matt.goo...@gmail.com
on 2 Dec 2009 at 11:23
Going to close this as Invalid for now, since it's probably not our issue.
Original comment by djc.ochtman
on 14 Dec 2009 at 11:07
Original issue reported on code.google.com by
tarun.pa...@gmail.com
on 1 Dec 2009 at 5:01