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

Launcher won't launch on Windows with python 3.9 #339

Closed
piraz opened this issue Mar 12, 2021 · 3 comments · Fixed by #346
Closed

Launcher won't launch on Windows with python 3.9 #339

piraz opened this issue Mar 12, 2021 · 3 comments · Fixed by #346
Assignees
Labels

Comments

@piraz
Copy link
Contributor

piraz commented Mar 12, 2021

I don't recall this errors with previous python versions and this is the error:

Traceback (most recent call last):
  File "C:\venvs\ntunnelenv\Lib\site-packages\firenado\bin\firenado-cli.py", line 21, in <module>
    run_from_command_line()
  File "C:\venvs\ntunnelenv\lib\site-packages\firenado\management\management.py", line 61, in run_from_command_line
    run_command(namespace.command, sys.argv[command_index-1:])
  File "C:\venvs\ntunnelenv\lib\site-packages\firenado\management\management.py", line 114, in run_command
    existing_command.run(args)
  File "C:\venvs\ntunnelenv\lib\site-packages\firenado\management\management.py", line 176, in run
    subcommand.run(unresolved_args)
  File "C:\venvs\ntunnelenv\lib\site-packages\firenado\management\management.py", line 180, in run
    self.run_tasks(args)
  File "C:\venvs\ntunnelenv\lib\site-packages\firenado\management\management.py", line 203, in run_tasks
    task.run(namespace)
  File "C:\venvs\ntunnelenv\lib\site-packages\firenado\management\tasks.py", line 143, in run
    launcher.launch()
  File "C:\venvs\ntunnelenv\lib\site-packages\firenado\launcher.py", line 212, in launch
    if self.add_sockets(self.port, address):
  File "C:\venvs\ntunnelenv\lib\site-packages\firenado\launcher.py", line 264, in add_sockets
    self.http_server.add_sockets(sockets)
  File "C:\venvs\ntunnelenv\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
    self._handlers[sock.fileno()] = add_accept_handler(
  File "C:\venvs\ntunnelenv\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler
    io_loop.add_handler(sock, accept_handler, IOLoop.READ)
  File "C:\venvs\ntunnelenv\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:\AppData\Local\Programs\Python\Python39\lib\asyncio\events.py", line 504, in add_reader
    raise NotImplementedError
NotImplementedError

Maybe will need to disable that part of the launcher entirely on Windows.

@piraz piraz added the bug label Mar 12, 2021
@piraz piraz added this to the Backlog milestone Mar 12, 2021
@piraz piraz self-assigned this Mar 12, 2021
@piraz piraz modified the milestones: Backlog, firenado 0.2.6 Mar 14, 2021
@piraz
Copy link
Contributor Author

piraz commented Mar 14, 2021

I can run without issues in python 3.7.

@piraz
Copy link
Contributor Author

piraz commented Mar 14, 2021

The issue is being tracked by tornado at tornadoweb/tornado#2608.

It was introduced with python 3.8 and was fixed on tornado 6.1.

This should be handled updating tornado.

@piraz
Copy link
Contributor Author

piraz commented Mar 14, 2021

The fix here is to patch asyncio to force it to use the event loop from windows "proactor" instead of the current from tornado "selector".

Here is the patch:

import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

Should be used at the launcher or we must use tornado 6.1.

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

Successfully merging a pull request may close this issue.

1 participant