Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions kyototycoon/kt_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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()
Expand Down