On Fri, Oct 7, 2011 at 7:23 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote:
> On Fri, Oct 7, 2011 at 11:16 AM, Kayode Odeyemi <drey...@gmail.com> wrote: > > Hello everyone, > > > > I'm writing a fairly large app which uses Oauth (python-oauth2). I am > trying > > to generate a > > public/private key pair on user supplied parameters > (whitespaced-delimited > > strings basically). > > > > When trying to encrypt the key, I'm getting the "unsupported operand > type(s) > > for pow(): 'unicode', 'long', 'long'" > > > > From Interactive shell, the program worked successfully. > > > > My question is do I have to make the user supplied data of a non-unicode > > string to make this work? > > Please include the traceback and the snippet of code where you make > the call that is failing. Without that, it is not at all clear > exactly what you are doing, especially since python-oauth2 does not > seem to provide any encryption API. > Thanks for writing in. I had this: encrypted = public_key.encrypt(params, 16) I was able to fix it with: encrypted = public_key.encrypt(str(params), 16) pow() needs params in non-unicode. I understand python-oauth2 does not have encryption API built-in. I'm creating one before using it. -- Odeyemi 'Kayode O. http://www.sinati.com. t: @charyorde
-- http://mail.python.org/mailman/listinfo/python-list