You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Name Version Build Channel
python 3.8.3 cpython_h5fd99cc_0 conda-forge
tornado 6.0.4 py38hfa6e2cd_0 conda-forge
snakeviz 2.0.1 py_0 conda-forge
When using snakeviz I get the followingerror and traceback:Traceback (most recent call last):
File "C:\Users\Martin\Miniconda3\Scripts\snakeviz-script.py", line 9, in <module>
sys.exit(main())
File "C:\Users\Martin\Miniconda3\lib\site-packages\snakeviz\cli.py", line 123, in main
app.listen(p, address=hostname)
File "C:\Users\Martin\Miniconda3\lib\site-packages\tornado\web.py", line 2116, in listen
server.listen(port, address)
File "C:\Users\Martin\Miniconda3\lib\site-packages\tornado\tcpserver.py", line 152, in listen
self.add_sockets(sockets)
File "C:\Users\Martin\Miniconda3\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
io_loop.add_handler(sock, accept_handler, IOLoop.READ)
File "C:\Users\Martin\Miniconda3\lib\site-packages\tornado\platform\asyncio.py", line 100, in add_handler
self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
File "C:\Users\Martin\Miniconda3\lib\asyncio\events.py", line 501, in add_reader
raise NotImplementedError
I believe the problem is caused by asyncio using an event loop that does not play nice with tornado's add_reader API (Tornado issue 2608). It is unclear if it will be fixed in the near future, as they believe that the event loop should be configured by applications and not tornado itself. The workaround is pretty simple. One should just add this snippet before starting the tornado server:
import sys, asyncio
if sys.version_info[0]==3 and sys.version_info[1] >= 8 and sys.platform.startswith('win'):
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
Alternatively, one could use the more elaborate function used in the jupyter notebook (jupyter/notebook commit 29ec93627c). It does essentially the same, but adds a couple more checks.
When I added one of the above options to the tornado/main.py file (after the imports) it solved the issue mentioned above. I can also submit a proper PR if you'd like.
The text was updated successfully, but these errors were encountered:
Damn, I've just realized it is fixed in 2.1. I checked the open issues for duplicates, but did not think to check the closed ones as well. Turns out this issue is a duplicate of #138 and #145. Sorry!
Hi,
My setup is the following:
When using snakeviz I get the followingerror and traceback:Traceback (most recent call last):
I believe the problem is caused by asyncio using an event loop that does not play nice with tornado's add_reader API (Tornado issue 2608). It is unclear if it will be fixed in the near future, as they believe that the event loop should be configured by applications and not tornado itself. The workaround is pretty simple. One should just add this snippet before starting the tornado server:
Alternatively, one could use the more elaborate function used in the jupyter notebook (jupyter/notebook commit 29ec93627c). It does essentially the same, but adds a couple more checks.
When I added one of the above options to the
tornado/main.py
file (after the imports) it solved the issue mentioned above. I can also submit a proper PR if you'd like.The text was updated successfully, but these errors were encountered: