Hi there -

The code I'm executing is running in Tornado as:


class HomeHandler(BaseHandler):
        def get(self):
                try:
                        ia = imdb.IMDb()
                except Exception, e:
                        print repr(traceback.format_stack())
                        
                self.render("home.html")

and the stack trace is ...

['  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py",
 line 71, in <module>\n    run_file(__file__, globals())\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py",
 line 67, in run_file\n    execfile(script_path, globals_)\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_main.py",
 line 525, in <module>\n    sys.exit(main(sys.argv))\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_main.py",
 line 510, in main\n    http_server.serve_forever()\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 3953, in serve_forever\n    self.handle_request()\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 3919, in handle_request\n    self._handle_request_noblock()\n', '  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py",
 line 281, in _handle_request_noblock\n    self.process_request(request, 
client_address)\n', '  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py",
 line 307, in process_request\n    self.finish_request(request, 
client_address)\n', '  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py",
 line 320, in finish_request\n    self.RequestHandlerClass(request, 
client_address, self)\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 3123, in __init__\n    
BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)\n', '  
File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/SocketServer.py",
 line 615, in __init__\n    self.handle()\n', '  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/BaseHTTPServer.py",
 line 329, in handle\n    self.handle_one_request()\n', '  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/BaseHTTPServer.py",
 line 323, in handle_one_request\n    method()\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 3131, in do_GET\n    self._HandleRequest()\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 3245, in _HandleRequest\n    self._Dispatch(dispatcher, self.rfile, 
outfile, env_dict)\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 3186, in _Dispatch\n    base_env_dict=env_dict)\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 531, in Dispatch\n    base_env_dict=base_env_dict)\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 2410, in Dispatch\n    self._module_dict)\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 2320, in ExecuteCGI\n    reset_modules = exec_script(handler_path, 
cgi_path, hook)\n', '  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py",
 line 2216, in ExecuteOrImportScript\n    exec module_code in 
script_module.__dict__\n', '  File 
"/Users/ron/Dropbox/code/cinemaApp/cinema.py", line 162, in <module>\n    
main()\n', '  File "/Users/ron/Dropbox/code/cinemaApp/cinema.py", line 158, in 
main\n    wsgiref.handlers.CGIHandler().run(application)\n', '  File 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/wsgiref/handlers.py",
 line 93, in run\n    self.result = application(self.environ, 
self.start_response)\n', '  File 
"/Users/ron/Dropbox/code/tornado/demos/appengine/tornado/wsgi.py", line 77, in 
__call__\n    handler = web.Application.__call__(self, 
HTTPRequest(environ))\n', '  File 
"/Users/ron/Dropbox/code/cinemaApp/tornado/web.py", line 1173, in __call__\n    
handler._execute(transforms, *args, **kwargs)\n', '  File 
"/Users/ron/Dropbox/code/cinemaApp/tornado/web.py", line 830, in _execute\n    
getattr(self, self.request.method.lower())(*args, **kwargs)\n', '  File 
"/Users/ron/Dropbox/code/cinemaApp/cinema.py", line 68, in get\n    print 
repr(traceback.format_stack())\n']
The call to render home.html works fine without the call to IMDb()

Thanks,
Ron

On 12 Feb 2011, at 18:47, Davide Alberani wrote:

> On Sat, Feb 12, 2011 at 7:34 PM, Ronald Hatcher <ronaldhatc...@mac.com> wrote:
>> I'm trying to use the library in a Google Appengine application by using a 
>> symlink to the imdb directory in my application code and I'm getting a 
>> "local variable 'logging' referenced before assignment" exception when I 
>> call ia = IMDb()
>> 
>> Do I need to add other dependent libraries or am I just doing this 
>> completely wrong?
> 
> Can you provide the complete traceback?
> Anyway, I've never tried to use IMDbPY in GAE, but from what I've heard
> it should work.
> It's possible that there's a bug in the use of the logging facility, but I 
> need
> to read the traceback to spot the problem.
> 
> By the way, you can try to import the logging module just before the above
> line, and see what happens (I don't remember if the 'logging' module
> provided in GAE is the system one, or a Google replacement).
> 
> 
> HTH,
> -- 
> Davide Alberani <davide.alber...@gmail.com>  [PGP KeyID: 0x465BFD47]
> http://www.mimante.net/

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Imdbpy-help mailing list
Imdbpy-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-help

Reply via email to