Open GoogleCodeExporter opened 9 years ago
Figured out what's causing the problem, at least:
This line in gauth.py:
hash_key = '%s&%s' % (urllib.quote(consumer_secret, safe='~'),
urllib.quote(token_secret, safe='~'))
Returns a unicode string for Python 2.7 and a regular string for 2.6. hmac.new
does not seem to like unicode inputs - only bytes. Can we have a patch for
this? How is it possible no one else has this problem - does no one use Python
2.7?
Original comment by ce...@leftronic.com
on 24 Jun 2012 at 11:57
I am seeing the same problem as well. 2.6.5 does not error, but 2.7.3 does.
Original comment by camemb...@gmail.com
on 14 Sep 2012 at 9:31
Same happens to me. The workaround that solve this was encode tokens and
secrets to ascii.
Example:
gauth.OAuthHmacToken(
settings.GDATA_CREDS['key'].encode('ascii'),
settings.GDATA_CREDS['secret'].encode('ascii'),
token.token.encode('ascii'),
token.token_secret.encode('ascii'),
gauth.ACCESS_TOKEN
)
Original comment by miguel.m...@gmail.com
on 19 Jun 2013 at 12:54
Original issue reported on code.google.com by
ce...@leftronic.com
on 24 Jun 2012 at 10:12