8000 OAuth1Session image data throws error with python3 · Issue #209 · litl/rauth · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
OAuth1Session image data throws error with python3 #209
Open
@marekrei

Description

@marekrei

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0