chrischabot / opensocial-python-client

Automatically exported from code.google.com/p/opensocial-python-client
Apache License 2.0
0 stars 0 forks source link

validator using incorrect Crypto module name #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Untar 0.3.2 release
2. Build and install
3. Run trivial program with "import opensocial"

What is the expected output? What do you see instead?

Import should succeed.

Instead, error output:
">>> import opensocial
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.6/site-packages/opensocial/__init__.py", line 32,
in <module>
    from validator import *
  File "/Library/Python/2.6/site-packages/opensocial/validator.py", line
26, in <module>
    from opensocial.Crypto.PublicKey import RSA
ImportError: No module named Crypto.PublicKey
"

What version of the product are you using? On what operating system?
0.3.2, running Python2.6 on MacOS10.6.2.

Please provide any additional information below.
The fix to issue 32 introduced this problem; the Crypto package is now
root-level and all imports must be changed to match.

Original issue reported on code.google.com by mhan...@gmail.com on 7 Jan 2010 at 12:43

GoogleCodeExporter commented 9 years ago
The same issue is present on the SVN head.

Original comment by mhan...@gmail.com on 7 Jan 2010 at 12:51

GoogleCodeExporter commented 9 years ago
Recommended patch against r89:

Index: src/opensocial/validator.py
===================================================================
--- src/opensocial/validator.py (revision 89)
+++ src/opensocial/validator.py (working copy)
@@ -23,8 +23,8 @@
 import hmac
 import logging

-from opensocial.Crypto.PublicKey import RSA
-from opensocial.Crypto.Util import number
+from Crypto.PublicKey import RSA
+from Crypto.Util import number

 class RequestValidator(object):
   def get_signature_base_string(self, method, url, params):

Original comment by mhan...@gmail.com on 7 Jan 2010 at 12:54