Skip to content


Subversion checkout URL

You can clone with
Download ZIP


auth.TwitterMixin is broken in python 3 #598

pfrantz opened this Issue · 1 comment

2 participants


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)
        "/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.


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.

@bdarnell bdarnell closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.