Skip to content

Commit 2159ac5

Browse files
committed
Fix for bug in r155.
--HG-- extra : convert_revision : svn%3A7a298fb0-333a-0410-83e7-658617cd9cf3/trunk%40159
1 parent b6c5dde commit 2159ac5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

couchdb/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,15 @@ def copy(self, src, dest):
381381
if not isinstance(dest, basestring):
382382
if not isinstance(dest, dict):
383383
if hasattr(dest, 'items'):
384-
dest = src.items()
384+
dest = dest.items()
385385
else:
386386
raise TypeError('expected dict or string, got %s' %
387387
type(dest))
388388
if '_rev' in dest:
389-
dest = '%s?rev=%s' % (dest['_id'], dest['_rev'])
389+
dest = '%s?%s' % (unicode_quote(dest['_id']),
390+
unicode_urlencode({'rev': dest['_rev']}))
390391
else:
391-
dest = dest['_id']
392+
dest = unicode_quote(dest['_id'])
392393

393394
resp, data = self.resource._request('COPY', src,
394395
headers={'Destination': dest})

0 commit comments

Comments
 (0)