It seems like not specifying the access system causes the problem.

I've put together a GAE app as

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from imdb import IMDb

class MainPage(webapp.RequestHandler):
    def get(self):

        ia = IMDb()
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.out.write(ia)

application = webapp.WSGIApplication(
                                     [('/', MainPage)],
                                     debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()

and the exception I get is

Traceback (most recent call last):
  File 
"/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/__init__.py",
 line 515, in __call__
    handler.get(*groups)
  File "/Users/ron/Dropbox/code/imdbpy/gae.py", line 8, in get
    ia = IMDb()
  File "/Users/ron/Dropbox/code/cinemaApp/imdb/__init__.py", line 159, in IMDb
UnboundLocalError: local variable 'logging' referenced before assignment
Specifying ia = IMDb('http') works fine. Looking through the code, if http 
isn't specified it grabs the logger before importing the appengine logging 
stuff ....


On 13 Feb 2011, at 08:35, Davide Alberani wrote:

> On Sat, Feb 12, 2011 at 11:21 PM, Ronald Hatcher <ronaldhatc...@mac.com> 
> wrote:
>> Hi there -
>> The code I'm executing is running in Tornado as:
> 
> Well... that traceback appears to be related to your exception handling (I 
> agree
> that there's an exception in the imdb.IMDb(), but it's not shown in that 
> stack).
> 
> Are you sure to have imported the 'traceback' module?  It looks a lot
> like a NameError on this line:
>  print repr(traceback.format_stack())
> 
> By the way, the output of traceback.print_exc() could be useful, in addition
> to the print of the tb stack.
> 
> Bye,
> -- 
> 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