<div class="gmail_quote">On Fri, Oct 7, 2011 at 7:23 PM, Ian Kelly <span dir="ltr"><<a href="mailto:ian.g.kelly@gmail.com">ian.g.kelly@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Fri, Oct 7, 2011 at 11:16 AM, Kayode Odeyemi <<a href="mailto:dreyemi@gmail.com">dreyemi@gmail.com</a>> wrote:<br>
> Hello everyone,<br>
><br>
> I'm writing a fairly large app which uses Oauth (python-oauth2). I am trying<br>
> to generate a<br>
> public/private key pair on user supplied parameters (whitespaced-delimited<br>
> strings basically).<br>
><br>
> When trying to encrypt the key, I'm getting the "unsupported operand type(s)<br>
> for pow(): 'unicode', 'long', 'long'"<br>
><br>
> From Interactive shell, the program worked successfully.<br>
><br>
> My question is do I have to make the user supplied data of a non-unicode<br>
> string to make this work?<br>
<br>
</div>Please include the traceback and the snippet of code where you make<br>
the call that is failing.  Without that, it is not at all clear<br>
exactly what you are doing, especially since python-oauth2 does not<br>
seem to provide any encryption API.<br></blockquote><div><br>Thanks for writing in.<br><br>I had this:<br><br>encrypted = public_key.encrypt(params, 16)<br><br>I was able to fix it with:<br><br>encrypted = public_key.encrypt(str(params), 16) <br>

<br>pow() needs params in non-unicode. <br><br>I understand python-oauth2 does not have encryption API built-in. I'm creating one<br>before using it.<br></div></div><br clear="all"><br>-- <br>Odeyemi 'Kayode O.<br>

<a href="http://www.sinati.com" target="_blank">http://www.sinati.com</a>. t: @charyorde<br><br>