wushuyi / passlib

Automatically exported from code.google.com/p/passlib
Other
0 stars 0 forks source link

Import error with Google App Engine #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Use Google App Engine
2. "import passlib.hash" in one of your modules.

And you will get a result similar to the following:

Traceback (most recent call last):
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 4144, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 4049, in _Dispatch
    base_env_dict=env_dict)
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 616, in Dispatch
    base_env_dict=base_env_dict)
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 3120, in Dispatch
    self._module_dict)
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 3024, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 2887, in ExecuteOrImportScript
    exec module_code in script_module.__dict__
  File "/home/justin/proj/feedbackswap/main.py", line 11, in <module>
    import passlib.hash
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
    return func(self, *args, **kwargs)
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 2503, in load_module
    return self.FindAndLoadModule(submodule, fullname, search_path)
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 1538, in Decorate
    return func(self, *args, **kwargs)
  File "/home/justin/sdk/gae/google/appengine/tools/dev_appserver.py", line 2396, in FindAndLoadModule
    module.__loader__ = self
  File "/home/justin/proj/feedbackswap/passlib/registry.py", line 45, in __setattr__
    register_crypt_handler(value, name=attr)
  File "/home/justin/proj/feedbackswap/passlib/registry.py", line 207, in register_crypt_handler
    raise TypeError("object does not appear to be a crypt handler: %r" % (handler,))
TypeError: object does not appear to be a crypt handler: 
<google.appengine.tools.dev_appserver.HardenedModulesHook object at 0xaff6aec>

Tested on Linux and GAE 1.5.2

Original issue reported on code.google.com by adek...@gmail.com on 12 Aug 2011 at 3:28

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. It looks like there's a couple of glitches that need 
fixing before Passlib works properly under GAE. I'll update this issue when 
it's done. 

Original comment by elic@astllc.org on 12 Aug 2011 at 8:39

GoogleCodeExporter commented 9 years ago
Passlib 1.5.1 has now been released, which should fix this bug. All unittests 
now pass under gaeunit on both development and production GAE environments. 

Original comment by elic@astllc.org on 17 Aug 2011 at 4:50