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'
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'))
Let me add that I didn't have this problem when dumping the database but
rather when loading the exported file into another one.
Did you find a solution to this?
I have the same problem when importing a db
In short, just replace
> db.resource.http.add_credentials(username, password)
by
> db.resource.credentials = (username, password)
I'll post patch a little later.