Skip to content

Commit 63eeab6

Browse files
committed
Ensure that csrf_token is a str for PY3.
1 parent 76e3585 commit 63eeab6

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
# built documents.
6060
#
6161
# The short X.Y version.
62-
version = '3.26'
62+
version = '3.27'
6363
# The full version, including alpha/beta/rc tags.
64-
release = '3.26'
64+
release = '3.27'
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.

dropbox/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,9 @@ def start(self, url_state=None):
15061506
your app, which gives your app permission to access the user's Dropbox account.
15071507
Tell the user to visit this URL and approve your app.
15081508
"""
1509-
csrf_token = base64.urlsafe_b64encode(os.urandom(16))
1509+
csrf_token = base64.urlsafe_b64encode(os.urandom(16)) # PY3: Returns bytes
1510+
if not isinstance(csrf_token, str):
1511+
csrf_token = csrf_token.decode('utf-8')
15101512
state = csrf_token
15111513
if url_state is not None:
15121514
state += "|" + url_state

dropbox/dropbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
]
44

55
# TODO(kelkabany): We need to auto populate this as done in the v1 SDK.
6-
__version__ = '3.26'
6+
__version__ = '3.27'
77

88
import contextlib
99
import json

dropbox/rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
else:
3232
url_encode = urllib.urlencode
3333

34-
SDK_VERSION = "3.26"
34+
SDK_VERSION = "3.27"
3535

3636
TRUSTED_CERT_FILE = pkg_resources.resource_filename(__name__, 'trusted-certs.crt')
3737

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
dist = setup(
2727
name='dropbox',
28-
version='3.26',
28+
version='3.27',
2929
description='Official Dropbox API Client',
3030
author='Dropbox',
3131
author_email='dev-platform@dropbox.com',

0 commit comments

Comments
 (0)