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

NotImplementedError raised when sphinx-autobuild tries to start tornado server on Python 3.8 #2756

Closed
bskinn opened this issue Oct 17, 2019 · 3 comments

Comments

@bskinn
Copy link

bskinn commented Oct 17, 2019

I just upgraded my Windows Python to 3.8.0 amd64, and now sphinx-autobuild is failing when it tries to bring up the web server. Based on the traceback, it looks to be a problem in tornado, trying to use a non-implemented (no-longer-implemented-in-3.8?) asyncio feature:

>make livehtml

+--------- manually triggered build ---------------------------------------------
| Running Sphinx v2.2.0
| loading pickled environment... done
| loading intersphinx inventory from isphx/objects_python.inv...
| loading intersphinx inventory from isphx/objects_numpy.inv...
| encountered some issues with some of the inventories, but they had working alternatives:
| intersphinx inventory 'isphx/objects_numpy.inv' not fetchable due to <class 'FileNotFoundError'>: [Errno 2] No such file or directory: 'C:\\...\\doc\\source\\isphx/objects_numpy.inv'
| building [mo]: targets for 0 po files that are out of date
| building [html]: targets for 0 source files that are out of date
| updating environment: 0 added, 0 changed, 0 removed
| looking for now-outdated files... none found
| no targets are out of date.
| build succeeded.
|
| The HTML pages are in build.
+--------------------------------------------------------------------------------

[I 191017 14:36:13 server:296] Serving on http://127.0.0.1:8000
Traceback (most recent call last):
  File "c:\...\python38\Lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\...\python38\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\...\env\Scripts\sphinx-autobuild.exe\__main__.py", line 7, in <module>
  File "c:\...\env\lib\site-packages\sphinx_autobuild\__init__.py", line 318, in main
    server.serve(port=portn, host=args.host, root=outdir)
  File "c:\...\env\lib\site-packages\livereload\server.py", line 298, in serve
    self.application(
  File "c:\...\env\lib\site-packages\livereload\server.py", line 253, in application
    app.listen(port, address=host)
  File "c:\...\env\lib\site-packages\tornado\web.py", line 2112, in listen
    server.listen(port, address)
  File "c:\...\env\lib\site-packages\tornado\tcpserver.py", line 152, in listen
    self.add_sockets(sockets)
  File "c:\...\env\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
    self._handlers[sock.fileno()] = add_accept_handler(
  File "c:\...\env\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler
    io_loop.add_handler(sock, accept_handler, IOLoop.READ)
  File "c:\...\env\lib\site-packages\tornado\platform\asyncio.py", line 99, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "c:\...\python38\Lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

Packages in the environment:

>pip list
Package                       Version
----------------------------- ----------
alabaster                     0.7.12
appdirs                       1.4.3
argh                          0.26.2
attrs                         17.4.0
Babel                         2.7.0
black                         19.3b0
bleach                        3.1.0
certifi                       2019.9.11
chardet                       3.0.4
Click                         7.0
colorama                      0.4.1
coverage                      4.5.4
docutils                      0.15.2
entrypoints                   0.3
filelock                      3.0.12
flake8                        3.7.8
flake8-docstrings             1.5.0
idna                          2.8
imagesize                     1.1.0
Jinja2                        2.10.3
livereload                    2.6.1
MarkupSafe                    1.1.1
mccabe                        0.6.1
numpy                         1.17.3+mkl
packaging                     19.2
pathtools                     0.1.2
pip                           19.3
pkginfo                       1.5.0.1
pluggy                        0.13.0
port-for                      0.3.1
py                            1.8.0
pycodestyle                   2.5.0
pydocstyle                    4.0.1
pyflakes                      2.1.1
Pygments                      2.4.2
pyparsing                     2.4.2
pytz                          2019.3
PyYAML                        5.1.2
readme-renderer               24.0
requests                      2.22.0
requests-toolbelt             0.9.1
restview                      2.9.2
setuptools                    41.4.0
six                           1.12.0
snowballstemmer               2.0.0
Sphinx                        2.2.0
sphinx-autobuild              0.7.1
sphinx-issues                 1.2.0
sphinx-rtd-theme              0.4.3
sphinxcontrib-applehelp       1.0.1
sphinxcontrib-devhelp         1.0.1
sphinxcontrib-htmlhelp        1.0.2
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.2
sphinxcontrib-serializinghtml 1.1.3
toml                          0.10.0
tornado                       6.0.3
tox                           3.14.0
tqdm                          4.36.1
twine                         2.0.0
urllib3                       1.25.6
virtualenv                    16.7.6
watchdog                      0.9.0
webencodings                  0.5.1
wheel                         0.33.6
@mivade
Copy link
Contributor

mivade commented Oct 17, 2019

This is related to #2608. The issue is that Python 3.8 changed the default event loop class on Windows which doesn't support add_reader and friends.

@bskinn
Copy link
Author

bskinn commented Oct 17, 2019

Ok, thanks -- based on that traceback, do you have any sense of where the right place is to file a bug report? Looks like either livereload or sphinx-autobuild?

@bskinn bskinn closed this as completed Oct 17, 2019
@mivade
Copy link
Contributor

mivade commented Oct 17, 2019

Probably sphinx-autobuild based on a quick glance at what's going on there. They would just need to add a line that sets the correct event loop policy when on Windows.

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

No branches or pull requests

2 participants