tumblr / pytumblr

A Python Tumblr API v2 Client
Apache License 2.0
723 stars 196 forks source link

Fix error with future.types.newstr.newstr and urllib.quote KeyError #94

Closed jasonpenny closed 6 years ago

jasonpenny commented 7 years ago

Merging in the code that uses future and requests-oauthlib created a problem with python2, creating a text post with spaces in the body is now raising an exception:

txt = client.create_text(
    blogName,
    state="published",
    slug="testing-text-posts",
    title="Testing",
    body="testing1 2 3 4")

raised KeyError: 116 in urllib.quote

This change converts the future.types.newstr.newstr to bytes and fixes the problem