Issue 214 in couchdb-python: Document.load() does not return None for non existent documents

11 views
Skip to first unread message

couchdb...@googlecode.com

unread,
Aug 22, 2012, 3:56:37 AM8/22/12
to couchdb...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 214 by silvan.k...@web.de: Document.load() does not return None
for non existent documents
http://code.google.com/p/couchdb-python/issues/detail?id=214

What steps will reproduce the problem?
1. Try to load a Document from an empty cdb (e.g. mydoc = MyDoc.load(db,
myid)
2. Test wether or not the document was loaded (e.g. if mydoc is None:)

What is the expected output? What do you see instead?
I would expect the if expression to eval to true but it fails

What version of the product are you using? On what operating system?
couchdb module 0.8, MacOS 10.8



couchdb...@googlecode.com

unread,
Aug 22, 2012, 4:02:09 AM8/22/12
to couchdb...@googlegroups.com

Comment #1 on issue 214 by kxepal: Document.load() does not return None for
What's actual result you got for nonexisted id?

couchdb...@googlecode.com

unread,
Aug 22, 2012, 9:47:05 AM8/22/12
to couchdb...@googlegroups.com

Comment #2 on issue 214 by silvan.k...@web.de: Document.load() does not
return None for non existent documents
http://code.google.com/p/couchdb-python/issues/detail?id=214

str() produces (PeakTimes is the document type, the following was loaded by
PeakTimes.load(id)):

<PeakTimes None@None {u'update_seq': 0, u'disk_size': 79, u'purge_seq': 0,
u'doc_count': 0, u'compact_running': False, u'db_name':
u'timeplanertestdb', u'doc_del_count': 0, u'instance_start_time':
u'1345619141158717', u'committed_update_seq': 0, u'data_size': 0,
u'disk_format_version': 6}>



couchdb...@googlecode.com

unread,
Aug 22, 2012, 9:48:06 AM8/22/12
to couchdb...@googlegroups.com

Comment #3 on issue 214 by silvan.k...@web.de: Document.load() does not
return None for non existent documents
http://code.google.com/p/couchdb-python/issues/detail?id=214

BTW, i'm using python 2.7.2

couchdb...@googlecode.com

unread,
Aug 22, 2012, 11:04:29 AM8/22/12
to couchdb...@googlegroups.com

Comment #4 on issue 214 by kxepal: Document.load() does not return None for
Looks like you've got dbinfo instead of document. This information is
available if you make GET request to database resource e.g
http://localhost:5984/dbname . Could you provide some code snippet that
reproduces problem to let me say what's wrong more directly?

couchdb...@googlecode.com

unread,
Aug 23, 2012, 4:18:13 AM8/23/12
to couchdb...@googlegroups.com

Comment #5 on issue 214 by silvan.k...@web.de: Document.load() does not
return None for non existent documents
http://code.google.com/p/couchdb-python/issues/detail?id=214

I will but as I'm going for a short vacation today this will happen next
week (probably wednesday).
Sorry for the delay & thanks for looking into this!

couchdb...@googlecode.com

unread,
Aug 29, 2012, 3:05:43 AM8/29/12
to couchdb...@googlegroups.com

Comment #6 on issue 214 by silvan.k...@web.de: Document.load() does not
return None for non existent documents
http://code.google.com/p/couchdb-python/issues/detail?id=214

Hmm, classical case of murphy.
I just wrote an example which ran as expected. Rechecking with my
application this now is running well, too, loading non existent documents
produces a None value.
Probably shutdown/restart of the system & the DBMS solved this...
Should this issue pop up again i'll immediately provide an example & logs,
sorry i took your time.
Cheers

couchdb...@googlecode.com

unread,
Oct 11, 2012, 7:40:26 PM10/11/12
to couchdb...@googlegroups.com
Updates:
Status: WorksForMe

Comment #7 on issue 214 by kxepal: Document.load() does not return None for
Good to hear that! Closing issue, but if you'll get it once again feel free
to report about - we'll reopen it.

Reply all
Reply to author
Forward
0 new messages