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

auth.TwitterMixin is broken in python 3 #598

Closed
pfrantz opened this issue Sep 28, 2012 · 1 comment
Closed

auth.TwitterMixin is broken in python 3 #598

pfrantz opened this issue Sep 28, 2012 · 1 comment

Comments

@pfrantz
Copy link

pfrantz commented Sep 28, 2012

The TwitterMixin is broken in python 3. When the response is returned an access_token dictionary is created with binary keys and values. This seems to be fine until the _oauth_get_user is called as it assumes the dictionary keys are strings and return value is also a string.

I have patched the routine as follows, but not sure if there are other problems lurking around due to access tokens being bytes.

def _oauth_get_user(self, access_token, callback):
    callback = self.async_callback(self._parse_user_response, callback)
    self.twitter_request(
        "/users/show/" + escape.to_basestring(access_token[b("screen_name")]),
        access_token=access_token, callback=callback)

don't know the code well enough to know whether its better to have access_tokens all converted to strings or leave them in byte format.

@bdarnell
Copy link
Member

This is fixed in the master branch with e7485f8

I've added some more tests so this should be enough, but please let me know if you see any other issues.

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

2 participants