diff options
| author | Tom Christie | 2015-01-22 13:50:51 +0000 |
|---|---|---|
| committer | Tom Christie | 2015-01-22 13:50:51 +0000 |
| commit | ca372ef6ef1cf95eb9282a484782e1a3721cb72b (patch) | |
| tree | 157b21c9e9abbadaac6368ffdd9ed0b162abaf09 /rest_framework | |
| parent | 94b5f7a86e401e46f14fb8982afaa7a8c61847c9 (diff) | |
| download | django-rest-framework-ca372ef6ef1cf95eb9282a484782e1a3721cb72b.tar.bz2 | |
Fix for python 3
Diffstat (limited to 'rest_framework')
| -rw-r--r-- | rest_framework/pagination.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rest_framework/pagination.py b/rest_framework/pagination.py index 61835239..0c5abccb 100644 --- a/rest_framework/pagination.py +++ b/rest_framework/pagination.py @@ -389,7 +389,7 @@ Cursor = namedtuple('Cursor', ['offset', 'reverse', 'position']) def decode_cursor(encoded): try: - tokens = urlparse.parse_qs(b64decode(encoded), keep_blank_values=True) + tokens = urlparse.parse_qs(b64decode(encoded).decode('ascii'), keep_blank_values=True) offset = int(tokens['offset'][0]) reverse = bool(int(tokens['reverse'][0])) position = tokens['position'][0] @@ -405,7 +405,7 @@ def encode_cursor(cursor): 'reverse': '1' if cursor.reverse else '0', 'position': cursor.position } - return b64encode(urlparse.urlencode(tokens, doseq=True)) + return b64encode(urlparse.urlencode(tokens, doseq=True).encode('ascii')) class CursorPagination(BasePagination): |
