CottageLabs / idfind

An identifier identifier
1 stars 0 forks source link

UnboundLocalError: implicit_key referenced before assignment #20

Closed emanuil-tolev closed 12 years ago

emanuil-tolev commented 12 years ago

A little bug:

127.0.0.1 - - [05/Mar/2012 14:42:07] "GET /favicon.ico HTTP/1.1" 500 - Traceback (most recent call last): File "C:\Python\lib\site-packages\flask\app.py", line 1306, in call return self.wsgi_app(environ, start_response) File "C:\Python\lib\site-packages\flask\app.py", line 1294, in wsgi_app response = self.make_response(self.handle_exception(e)) File "C:\Python\lib\site-packages\flask\app.py", line 1292, in wsgi_app response = self.full_dispatch_request() File "C:\Python\lib\site-packages\flask\app.py", line 1062, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Python\lib\site-packages\flask\app.py", line 1060, in full_dispatch_request rv = self.dispatch_request() File "C:\Python\lib\site-packages\flask\app.py", line 1047, in dispatch_request return self.view_functionsrule.endpoint File "C:\Users\eet10\Desktop\cl\idfind\idfind\web.py", line 254, in search io = dosearch(path.replace(".json","")) File "C:\Users\eet10\Desktop\cl\idfind\idfind\web.py", line 289, in dosearch if implicit_key: UnboundLocalError: local variable 'implicit_key' referenced before assignment

Seems to appear when the browser tries a favicon request. Severely pollutes the log however, and makes debugging via the simple means of

print whatever # will print it during the processing of each request by web.py

a big pain if each request also makes it spew an 18-line error.

emanuil-tolev commented 12 years ago

I fixed it, but not seeing requests 127.0.0.1 - - [05/Mar/2012 14:42:07] "GET /favicon.ico HTTP/1.1" 500 like this one at all now. I presume the browser is still requesting a favicon, it's just that 404 not founds don't get logged to standard output for some reason (some Flash default setting or something).