Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with post or put if type(data) is bytes #185

Open
DavidRueter opened this issue Nov 4, 2015 · 2 comments · May be fixed by maxcountryman/rauth#2
Open

Error with post or put if type(data) is bytes #185

DavidRueter opened this issue Nov 4, 2015 · 2 comments · May be fixed by maxcountryman/rauth#2

Comments

@DavidRueter
Copy link

There seems to be an error in session.py at line 230 that manifests itself when you pass in a value of type bytes to the data= parameter in either .post or .put

Original code:

if oauth_param in data:

But this assumes that data is a dictionary...and this fails with an error if data is bytes.

From the documentation, data should accept bytes:

:param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:'Request'.

I think the code should be updated to:

if not isinstance(data, bytes) and oauth_param in data:
@maxcountryman
Copy link
Contributor

The proposed fix seems reasonable to me.

@hendi
Copy link

hendi commented Sep 29, 2017

Fixed this in my fork

@hendi hendi linked a pull request Oct 9, 2017 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants