diff --git a/kyototycoon/kt_http.py b/kyototycoon/kt_http.py index 9311494..d5390e6 100644 --- a/kyototycoon/kt_http.py +++ b/kyototycoon/kt_http.py @@ -365,8 +365,7 @@ def get(self, key, db=None): path = key if db: - path = '/%s/%s' % (db, key) - path = quote(path.encode('UTF-8')) + path = '/%s/%s' % (quote(db.encode('UTF-8')), quote(key).encode('UTF-8')) self.conn.request('GET', path) res, body = self.getresponse() @@ -497,8 +496,7 @@ def get_int(self, key, db=None): path = key if db: - path = '/%s/%s' % (db, key) - path = quote(path.encode('UTF-8')) + path = '/%s/%s' % (quote(db.encode('UTF-8')), quote(key).encode('UTF-8')) self.conn.request('GET', path) @@ -623,9 +621,8 @@ def add(self, key, value, expire, db): return False if db: - key = '/%s/%s' % (db, key) + key = '/%s/%s' % (quote(db.encode('UTF-8')), quote(key).encode('UTF-8')) - key = quote(key.encode('UTF-8')) value = self.pack(value) status = self._rest_put('add', key, value, expire) @@ -673,9 +670,8 @@ def remove(self, key, db): return False if db: - key = '/%s/%s' % (db, key) + key = '/%s/%s' % (quote(db.encode('UTF-8')), quote(key).encode('UTF-8')) - key = quote(key.encode('UTF-8')) self.conn.request('DELETE', key) res, body = self.getresponse()