Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1118

Example code for Twisted API returns error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.1.2
    • None
    • apidocs, docs
    • None
    • 1

    Description

      The Example code for Twisted API provided at https://pypi.org/project/couchbase/3.0.9/ runs with an error:

      $ python3.9 demo.py 
      Traceback (most recent call last):
        File "/Users/yuvrajkanwar/PycharmProjects/demo308/venv/demo.py", line 9, in <module>
          cluster = TxCluster('couchbase://10.112.206.101', ClusterOptions(PasswordAuthenticator('Administrator', 'password')))
        File "/usr/local/lib/python3.9/site-packages/txcouchbase/cluster.py", line 582, in __init__
          super(TxCluster, self).__init__(*args, bucket_factory=kwargs.pop('bucket_factory', TxBucket), **kwargs)
        File "/usr/local/lib/python3.9/site-packages/txcouchbase/cluster.py", line 353, in __init__
          super(TxDeferredClientMixin, self).__init__(*args, **kwargs)
        File "/usr/local/lib/python3.9/site-packages/txcouchbase/cluster.py", line 464, in __init__
          super(TxRawCluster, self).__init__(*args, bucket_factory=kwargs.pop('bucket_factory', TxRawBucket), **kwargs)
      TypeError: __init__() takes from 1 to 2 positional arguments but 3 were given
      

       
      In fact, in the original form, it won't even compile as that code seems to be using `couchbase.cluster.ClusterOptions` and `couchbase.cluster.PasswordAuthenticator` which is not part of imports.

      We should provide a better example code for this documentation.

       

       

      Attachments

        Activity

          People

            jared.casey Jared Casey
            yuvraj.kanwar Yuvraj Kanwar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty