bmjjr · GitHub

  • gevent version: 1.3b2
  • Python version: Cpython from miniconda, tried both 3.6.4-0 conda-forge, 3.6.5-1 conda-forge
  • Operating System: Windows 10 Pro Version 10.0.16299 Build 16299

Description:

I'm running a gevent based WSGI server on windows for a flask app. I upgraded from gevent 1.3a1 to 1.3b2 and the server fails to start, receiving a traceback:

File "src\gevent\local.py", line 374, in gevent._local.local.__cinit__
File "src\gevent\local.py", line 540, in gevent._local._local_find_descriptors
TypeError: Expected type, got ABCMeta
Process finished with exit code 1

What I've run:

I'm monkey patching at the top of my manage.py file and below is the server code. Reverting back to 1.3a1 works fine.

def prodserver(host="127.0.0.1", port=8000):
    """Run a gevent-based WSGI server."""
    port = int(port)
    wrapped_app = app
    if app.config.get("DEBUG", True):
        wrapped_app = werkzeug.debug.DebuggedApplication(app)
        logging.basicConfig(filename='error.log', level=logging.DEBUG)
    server = WSGIServer(listener=(host, port), application=wrapped_app,
                        handler_class=WSGIHandler)
    def serve():
        print(" * Running on http://%s:%d/" % (host, port))
        server.serve_forever()
    if app.debug:
        werkzeug.serving.run_with_reloader(
            serve,
            reloader_type="stat" if sys.platform == "win32" else "auto")
    else:
        serve()

Read the original on github.com ↗