Issue 194 in couchdb-python: couchdb-load attribute error: 'Resource' object has no attribute 'http'

48 views
Skip to first unread message

couchdb...@googlecode.com

unread,
Aug 17, 2011, 4:43:21 AM8/17/11
to couchdb...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 194 by tomas.k...@gmail.com: couchdb-load attribute
error: 'Resource' object has no attribute 'http'
http://code.google.com/p/couchdb-python/issues/detail?id=194

Installed couchdb-python on Ubuntu 10.10, python version 2.6.5;
couchdb-dump script correctly dumps a local database, but when running the
couchdb-load script, I get the following error:

couchdb-load --input=cms.json -u fake -p invalid localhost:5984/dbname

Traceback (most recent call last):
File "/usr/local/bin/couchdb-load", line 9, in <module>
load_entry_point('CouchDB==0.9dev', 'console_scripts', 'couchdb-load')()

File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.9dev-py2.6.egg/couchdb/tools/load.py",
line 87, in main
password=options.password, ignore_errors=options.ignore_errors)

File "/usr/local/lib/python2.6/dist-packages/CouchDB-0.9dev-py2.6.egg/couchdb/tools/load.py",
line 27, in load_db
db.resource.http.add_credentials(username, password)
AttributeError: 'Resource' object has no attribute 'http'


couchdb...@googlecode.com

unread,
Sep 4, 2011, 7:18:20 AM9/4/11
to couchdb...@googlegroups.com

Comment #1 on issue 194 by ahmed.ri...@gmail.com: couchdb-load attribute
error: 'Resource' object has no attribute 'http'
http://code.google.com/p/couchdb-python/issues/detail?id=194

I got the same problem when trying to dump/load from python-client like :
from couchdb.tools import load, dump
dump.dump_db('http://127.0.0.1:5984/koko', username='admin',
password='couch', open('koko', 'w'))
But I tried this and worked fine :
dump.dump_db('http://admin:co...@127.0.0.1:5984/koko',
output=open('koko', 'w'))

couchdb...@googlecode.com

unread,
Sep 4, 2011, 8:40:38 AM9/4/11
to couchdb...@googlegroups.com

Comment #2 on issue 194 by tomas.k...@gmail.com: couchdb-load attribute
error: 'Resource' object has no attribute 'http'
http://code.google.com/p/couchdb-python/issues/detail?id=194

Let me add that I didn't have this problem when dumping the database but
rather when loading the exported file into another one.

Ahmed Refaey

unread,
Sep 4, 2011, 9:05:39 AM9/4/11
to couchdb...@googlegroups.com, codesite...@google.com
I faced the same when trying loading using :
load.load_db(open('koko'), 'http://127.0.0.1:5984/kiki', username='admin', password='couch')

But this worked :

load.load_db(open('koko'), 'http://admin:co...@127.0.0.1:5984/kiki')

couchdb...@googlecode.com

unread,
Feb 9, 2012, 9:22:49 AM2/9/12
to couchdb...@googlegroups.com

Comment #3 on issue 194 by strtw...@gmail.com: couchdb-load attribute
error: 'Resource' object has no attribute 'http'
http://code.google.com/p/couchdb-python/issues/detail?id=194

Did you find a solution to this?

I have the same problem when importing a db

couchdb...@googlecode.com

unread,
Feb 9, 2012, 10:00:11 AM2/9/12
to couchdb...@googlegroups.com

Comment #4 on issue 194 by kxepal: couchdb-load attribute error: 'Resource'

In short, just replace
> db.resource.http.add_credentials(username, password)
by
> db.resource.credentials = (username, password)

I'll post patch a little later.


couchdb...@googlecode.com

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

Comment #5 on issue 194 by djc.ochtman: couchdb-load attribute
error: 'Resource' object has no attribute 'http'
http://code.google.com/p/couchdb-python/issues/detail?id=194

(No comment was entered for this change.)

couchdb...@googlecode.com

unread,
Oct 5, 2012, 4:29:28 PM10/5/12
to couchdb...@googlegroups.com

Comment #6 on issue 194 by kxepal: couchdb-load attribute error: 'Resource'
Patch with tests attached.

Attachments:
couchdb-python-194.1.patch 2.4 KB

couchdb...@googlecode.com

unread,
Oct 9, 2012, 4:09:28 AM10/9/12
to couchdb...@googlegroups.com
Updates:
Status: Fixed

Comment #7 on issue 194 by matt.goo...@gmail.com: couchdb-load attribute
error: 'Resource' object has no attribute 'http'
http://code.google.com/p/couchdb-python/issues/detail?id=194

Fixed in r58b76bbcb082, thanks.

Reply all
Reply to author
Forward
0 new messages