6

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.

Community
  • 1
  • 1
Sergei Basharov
  • 51,276
  • 73
  • 200
  • 335
  • Could you please share your code? Otherwise, we have no way of reproducing the problem. Also, which version of python are you using? – linqq Nov 19 '11 at 20:30
  • Did you ever find the solution to this problem? – trinth Dec 20 '11 at 23:45

2 Answers2

3

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

linqq
  • 3,067
  • 2
  • 19
  • 17
2

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?

Community
  • 1
  • 1
Vroo
  • 1,064
  • 1
  • 11
  • 19
  • 1
    I fixed the typo. Did you really think that was a constructive comment? There's a reason that stackoverflow lets you suggest edits to other people's answers. – Vroo Dec 09 '13 at 20:09
  • 3
    Agree. I would have welcomed a correction. Saying that there's no true in Python is snarky. – Vroo Dec 21 '13 at 06:29
  • 1
    This answer should be on top. A long time has gone since the question was originally posted, and I bet that most if not all of the people reaching to it now are looking for this answer, not for the development version of werkzeug – rll Aug 04 '15 at 15:40