Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyerror #26

Closed
b-3-n opened this issue May 10, 2014 · 4 comments
Closed

Keyerror #26

b-3-n opened this issue May 10, 2014 · 4 comments

Comments

@b-3-n
Copy link

b-3-n commented May 10, 2014

Hi,

I got another issue on termination of Flask-SocketIO apps:

Running:

http://pastebin.com/RGAPteXM

gives me:

http://pastebin.com/HFTM7nfr

Running the same code without "app.debug = True" gives me:

http://pastebin.com/rXc77u0t

I'm running Ubuntu 13.10 and execute the app using python 2.7.5.

Best regards

ben

@miguelgrinberg
Copy link
Owner

According to this SO question this is caused by wrong import order, in particular when importing threading before monkey-patching it.

So it would seem that if you add the following at the top of the file (before the other imports) the problem will disappear:

from gevent import monkey
monkey.patch_all()

This would also need to go in the unit test.

Can you try it and confirm it works? The machine I'm currently on (Windows + Cygwin) does not do this, so I can't verify right now. Thanks.

@b-3-n
Copy link
Author

b-3-n commented May 12, 2014

I can confirm that the KeyError-issue is resolved by your proposed solution. Thank you for that. However without app.debug=True I still get http://pastebin.com/urw6Bjdp which is kinda strange because as far as I see it is just a Traceback without an error. Is this normal?

Best regards

ben

@miguelgrinberg
Copy link
Owner

It is a KeyboardInterrupt, triggered by the Ctrl+C. I can catch it and exit cleanly. I'll post an update with these two fixes later today.

@miguelgrinberg
Copy link
Owner

I left the KeyboardInterrupt error alone for now. I can't reproduce it exactly as it looks for you, for me I have to hit Ctrl+C twice to exit, both in debug and non-debug modes, and I get no stack trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants