Python Client Library import bug and fix
Mon, 07/02/2012 - 04:39
Using the Python Client Library 2.0 developer preview, version 0.6 from http://www.couchbase.com/develop/python/next
Importing views from JSON with couchbase-migrator.py fails with:
File "C:\Python27\Lib\site-packages\couchbase\utils\couchbase-migrator.py", li
ne 117, in <module>
writer.write(record)
File "C:\Python27\lib\site-packages\couchbase\migrator\migrator_couchbase.py",
line 73, in write
self.bucket.save(record_save)
File "C:\Python27\lib\site-packages\couchbase\client.py", line 284, in save
rest.create_view(self.bucket_name, view, json.dumps(value))
AttributeError: 'RestConnection' object has no attribute 'create_view'In couchbase/client.py, line 284, a reference is made to a method "create_view" that does not exist anywhere in the library. Changing this to "create_design_doc" (from the Python Client Library for 1.8) and import works fine again.
Leaving this here so that other with the same issue may find it and the bug can be fixed in an upcoming release.
Thanks for pointing this out. I have filed a bug for this issue here:
http://www.couchbase.com/issues/browse/PYCBC-35