Skip to content

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

Open
@zeitkunst

Description

@zeitkunst

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions