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

OAuth1Session image data throws error with python3 #209

Open
marekrei opened this issue Jul 15, 2020 · 0 comments
Open

OAuth1Session image data throws error with python3 #209

marekrei opened this issue Jul 15, 2020 · 0 comments

Comments

@marekrei
Copy link

I'm trying to pass image an image file as data using OAuth1Session.

On line 228 of session.py there is a following check:

if oauth_param in data:

oauth_param in that context is taken from OPTIONAL_OAUTH_PARAMS and has type 'str'.
data is the image I'm uploading and has type 'bytes'.

Checking for a string in bytes produces an exception in python3.7:

File "/home/marek/anaconda3/envs/smuploader/lib/python3.7/site-packages/rauth/session.py", line 228, in _parse_optional_params
    if oauth_param in data:
TypeError: a bytes-like object is required, not 'str'

Am I missing something or is this a bug in rauth?

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

No branches or pull requests

1 participant