GithubHelp home page GithubHelp logo

Keyerror about flask-socketio HOT 4 CLOSED

miguelgrinberg avatar miguelgrinberg commented on August 23, 2024
Keyerror

from flask-socketio.

Comments (4)

miguelgrinberg avatar miguelgrinberg commented on August 23, 2024

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.

from flask-socketio.

b-3-n avatar b-3-n commented on August 23, 2024

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

from flask-socketio.

miguelgrinberg avatar miguelgrinberg commented on August 23, 2024

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.

from flask-socketio.

miguelgrinberg avatar miguelgrinberg commented on August 23, 2024

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.

from flask-socketio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.