Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE9 hangs local Flask instance

A web app I am working on works fine under Firefox and IE8 from virtual box. But when I try to load it with IE9, it tries to load the page but after a while stops loading. Then I try to load the same url with Firefox again and it doesn't load at all. Then I restart Flask and the same happens - I can work normally with the app through FF but not IE9. Looks like a kind of a bug, doesn't it?

Here is the exception Python throws:

Exception happened during processing of request from ('127.0.0.1', 6924)
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock
    self.process_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 310, in process_request
    self.finish_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python27\lib\SocketServer.py", line 639, in __init__
    self.handle()
  File "C:\Users\Cosmo\AppData\Roaming\Python\Python27\site-packages\werkzeug\serving.py", line 189, in handle
    return rv
UnboundLocalError: local variable 'rv' referenced before assignment

I have uploaded code to my hosting and it works fine there.

I think the issue from this thread is similar to my one.

like image 222
Sergei Basharov Avatar asked Nov 18 '11 09:11

Sergei Basharov


2 Answers

Try using a git version of werkzeug. According to the author, a similar bug was recently fixed.

like image 119
linqq Avatar answered Oct 01 '22 22:10

linqq


I've been having problems with IE hanging my flask server with more recent versions of Flask/Werkzeug (+2 years from this thread). The solution I found was to use run(threaded=True) as described in this other question: Can I serve multiple clients using just Flask app.run() as standalone?

like image 33
Vroo Avatar answered Oct 01 '22 22:10

Vroo