lanto03 / couchdb-python

Automatically exported from code.google.com/p/couchdb-python
Other
0 stars 0 forks source link

Fail on generation basic auth header for python 3 #239

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Python 3.4.1 (default, Jun 30 2014, 00:39:13) 
[GCC 4.8.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import couchdb
>>> server = couchdb.Server('http://root:relax@localhost:5984')
>>> server.config()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/opt/virtualenv/couchdb3k/lib/python3.4/site-packages/couchdb/client.py", line 153, in config
    status, headers, data = self.resource.get_json('_config')
  File "/usr/local/opt/virtualenv/couchdb3k/lib/python3.4/site-packages/couchdb/http.py", line 555, in get_json
    return self._request_json('GET', path, headers=headers, **params)
  File "/usr/local/opt/virtualenv/couchdb3k/lib/python3.4/site-packages/couchdb/http.py", line 578, in _request_json
    headers=headers, **params)
  File "/usr/local/opt/virtualenv/couchdb3k/lib/python3.4/site-packages/couchdb/http.py", line 574, in _request
    credentials=self.credentials)
  File "/usr/local/opt/virtualenv/couchdb3k/lib/python3.4/site-packages/couchdb/http.py", line 302, in request
    authorization = basic_auth(credentials)
  File "/usr/local/opt/virtualenv/couchdb3k/lib/python3.4/site-packages/couchdb/http.py", line 610, in basic_auth
    return 'Basic %s' % b64encode('%s:%s' % credentials)
  File "/usr/local/opt/virtualenv/couchdb3k/lib64/python3.4/base64.py", line 62, in b64encode
    encoded = binascii.b2a_base64(s)[:-1]
TypeError: 'str' does not support the buffer interface

Original issue reported on code.google.com by kxepal on 7 Jul 2014 at 2:28

GoogleCodeExporter commented 8 years ago

Original comment by kxepal on 7 Jul 2014 at 2:29

Attachments:

GoogleCodeExporter commented 8 years ago
I pushed a modified version of your fix as r4715ee910e9c (you had not actually 
run your doctests against 2.7, it seems). Thanks!

Original comment by djc.ochtman on 7 Jul 2014 at 8:28

GoogleCodeExporter commented 8 years ago

Original comment by djc.ochtman on 7 Jul 2014 at 8:28