python-oauth2 icon indicating copy to clipboard operation
python-oauth2 copied to clipboard

TypeError with python2.7 on natty and PPA version of python-oauth2

Open zeitkunst opened this issue 14 years ago • 3 comments
trafficstars

I'm building an application and using your provided python-oauth2 deb from the PPA. Everything works on Ubuntu maverick and python2.6. On natty and python2.7 (the default for natty), I get the following error, which seems to have something to do with changes in the hmac library:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/FluidNexus/GUI.py", line 1112, in onRequestAuthorization
    request = build_request_token_request(REQUEST_TOKEN_URL, unicode(self.ui.keyInput.text()), unicode(self.ui.secretInput.text()))
  File "/usr/lib/pymodules/python2.7/FluidNexus/GUI.py", line 97, in build_request_token_request
    req.sign_request(signature_method, consumer, None)
  File "/usr/lib/pymodules/python2.7/oauth2/__init__.py", line 381, in sign_request
    self['oauth_signature'] = signature_method.sign(self, consumer, token)
  File "/usr/lib/pymodules/python2.7/oauth2/__init__.py", line 712, in sign
    hashed = hmac.new(key, raw, sha)
  File "/usr/lib/python2.7/hmac.py", line 133, in new
    return HMAC(key, msg, digestmod)
  File "/usr/lib/python2.7/hmac.py", line 72, in __init__
    self.outer.update(key.translate(trans_5C))
TypeError: character mapping must return integer, None or unicode

If I install python2.6 and change my script to use that everything works properly.

I'm not well-enough versed in the hmac module to know what's going on...

Thanks for your help! And thanks for your PPA packaging!

zeitkunst avatar Aug 08 '11 06:08 zeitkunst

This would appear to be a known issue with hmac (see http://bugs.python.org/issue5285), but it also appears to be fixed in the latest git of python-oauth2. Is there any chance of updating the PPA to reflect this?

zeitkunst avatar Aug 08 '11 18:08 zeitkunst

@joestump do we have access to the ppa?

jaitaiwan avatar Jul 29 '15 12:07 jaitaiwan

I actually removed the Debian packages recently. Where is the PPA hosted? I might know the guy.

joestump avatar Aug 02 '15 21:08 joestump