-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -436,9 +436,13 @@ def _params_to_urlencoded(params): | |
the exception of unicode objects which are utf8-encoded. | ||
""" | ||
def encode(o): | ||
if isinstance(o, six.text_type): | ||
return o.encode('utf8') | ||
if isinstance(o, six.binary_type): | ||
return o | ||
else: | ||
return str(o) | ||
if isinstance(o, six.text_type): | ||
return o.encode('utf-8') | ||
else: | ||
return str(o).encode('utf-8') | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
braincore
Author
Contributor
|
||
|
||
utf8_params = {encode(k): encode(v) for k, v in six.iteritems(params)} | ||
return url_encode(utf8_params) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
|
||
dist = setup( | ||
name='dropbox', | ||
version='5.2', | ||
version='5.2.1', | ||
description='Official Dropbox API Client', | ||
author='Dropbox', | ||
author_email='[email protected]', | ||
|
@braincore: Though this is convenient for numbers, it'll mask bugs in other cases. Maybe it's better to require that
params
consists solely of str/unicode values andassert
on anything else?Also, might be easier to read with
elif
.