question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error while running the server example from the docs

See original GitHub issue

I’m trying to run this example which is in the docs here

import eventlet
import socketio

sio = socketio.Server()
app = socketio.WSGIApp(sio, static_files={
    '/': {'content_type': 'text/html', 'filename': 'index.html'}
})

@sio.event
def connect(sid, environ):
    print('connect ', sid)

@sio.event
def my_message(sid, data):
    print('message ', data)

@sio.event
def disconnect(sid):
    print('disconnect ', sid)

if __name__ == '__main__':
    eventlet.wsgi.server(eventlet.listen(('', 5000)), app)

But as soon as I execute it I get this error

(15262) wsgi starting up on http://0.0.0.0:5000
(15262) wsgi exited, is_accepting=True
Traceback (most recent call last):
  File "the_path_in_my_pc/__init__.py", line 70, in <module>
    eventlet.wsgi.server(eventlet.listen(('', 5000)), app)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/eventlet/wsgi.py", line 990, in server
    client_socket, client_addr = sock.accept()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/eventlet/greenio/base.py", line 230, in accept
    self._trampoline(fd, read=True, timeout=self.gettimeout(), timeout_exc=_timeout_exc)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/eventlet/greenio/base.py", line 208, in _trampoline
    return trampoline(fd, read=read, write=write, timeout=timeout,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/eventlet/hubs/__init__.py", line 155, in trampoline
    listener = hub.add(hub.READ, fileno, current.switch, current.throw, mark_as_closed)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/eventlet/hubs/kqueue.py", line 53, in add
    self._control([event], 0, 0)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/eventlet/hubs/kqueue.py", line 39, in _control
    return self.kqueue.control(events, max_events, timeout)
TypeError: changelist must be an iterable of select.kevent objects

What may be the cause?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
leadscloudcommented, Mar 9, 2021

@miguelgrinberg only at macos with python3.9

4reactions
Pizzafacecommented, Mar 4, 2022

I realize this issue is stale, however since this is an edge issue - and this is the first result on Google while researching, here’s how I was able to work around the issue.

Only applicable for 3.9.x from what I’ve seen

  1. Install uvloop (pip install uvloop)
  2. import uvloop at the beginning of your code.
  3. Before invoking the event loop - run uvloop.install()

This should stop it from giving this issue.

Hope this helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling - Apollo GraphQL Docs
Throwing errors​​ For example, it throws a GRAPHQL_VALIDATION_FAILED error whenever an incoming operation isn't valid against the server's schema. Your resolvers ...
Read more >
Troubleshoot Cloud Run issues
The following error occurs when you try to deploy or try to call another Google Cloud API: The server has encountered an internal...
Read more >
How to resolve Nodejs: Error: ENOENT: no such file or directory
In my project when I ran an express app I noticed that the current working directory was the root directory of the project...
Read more >
Troubleshooting | Apps Script - Google Developers
There are a few possible causes for these errors: A Google server or system is temporarily unavailable. Wait for a few moments and...
Read more >
A network-related or instance-specific error occurred - SQL ...
You can also view the SQL Server error log by using a text editor. By default, the error log is located at Program...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found