gcarranza / couchdb-python

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

tools/replicate isn't compatible with python 3 #240

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Traceback (most recent call last):
  File "couchdb/tools/replicate.py", line 122, in <module>
    main()
  File "couchdb/tools/replicate.py", line 75, in main
    sbase, spath = findpath(parser, src)
  File "couchdb/tools/replicate.py", line 34, in findpath
    bits = util.urlparse(s)
AttributeError: 'module' object has no attribute 'urlparse'

and after fixing import:

Traceback (most recent call last):
  File "couchdb/tools/replicate.py", line 123, in <module>
    main()
  File "couchdb/tools/replicate.py", line 76, in main
    sbase, spath = findpath(parser, src)
  File "couchdb/tools/replicate.py", line 43, in findpath
    data = res.get_json(parts[:i])[2]
  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 569, in _request
    url = urljoin(self.url, path, **params)
  File "/usr/local/opt/virtualenv/couchdb3k/lib/python3.4/site-packages/couchdb/http.py", line 675, in urljoin
    path = '/'.join([''] + [quote(s) for s in path])
  File "/usr/local/opt/virtualenv/couchdb3k/lib/python3.4/site-packages/couchdb/http.py", line 675, in <listcomp>
    path = '/'.join([''] + [quote(s) for s in path])
  File "/usr/local/opt/virtualenv/couchdb3k/lib/python3.4/site-packages/couchdb/http.py", line 627, in quote
    return util.urlquote(string, safe)
  File "/usr/lib64/python3.4/urllib/parse.py", line 694, in quote
    return quote_from_bytes(string, safe)
  File "/usr/lib64/python3.4/urllib/parse.py", line 719, in quote_from_bytes
    raise TypeError("quote_from_bytes() expected bytes")
TypeError: quote_from_bytes() expected bytes

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

GoogleCodeExporter commented 9 years ago
Forgot the error on build:

byte-compiling build/bdist.linux-x86_64/egg/couchdb/tools/replicate.py to 
replicate.cpython-34.pyc
  File "build/bdist.linux-x86_64/egg/couchdb/tools/replicate.py", line 101
    print sdb, '->', tdb,
            ^
SyntaxError: invalid syntax

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

GoogleCodeExporter commented 9 years ago

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

Attachments:

GoogleCodeExporter commented 9 years ago
I've fixed these in a slightly different way, in rf305cd0e4a43. Thanks!

Original comment by djc.ochtman on 7 Jul 2014 at 9:50