sphinx-doc / sphinx-autobuild

Watch a Sphinx directory and rebuild the documentation when a change is detected. Also includes a hot-reload web server.
MIT License
521 stars 76 forks source link

Need to require python>=3.10 instead of python>=3.9 #166

Open kevinli1993 opened 1 week ago

kevinli1993 commented 1 week ago

Due to the usage of the strict argument in server.py

self.paths = [os.path.realpath(path, strict=True) for path in paths]

we need to require Python 3.10 or above. (Per the documentation, the strict argument is only available after Python 3.10).

Running with Python 3.9 results in the following error/traceback:

$ sphinx-autobuild ... .../_build/html
Traceback (most recent call last):
  File "..../bin/sphinx-autobuild", line 8, in <module>
    sys.exit(main())
  File "..../lib/python3.9/site-packages/sphinx_autobuild/__main__.py", line 54, in main
    watcher = RebuildServer(watch_dirs, ignore_handler, change_callback=builder)
  File "..../lib/python3.9/site-packages/sphinx_autobuild/server.py", line 27, in __init__
    self.paths = [os.path.realpath(path, strict=True) for path in paths]
  File "..../lib/python3.9/site-packages/sphinx_autobuild/server.py", line 27, in <listcomp>
    self.paths = [os.path.realpath(path, strict=True) for path in paths]
TypeError: realpath() got an unexpected keyword argument 'strict'
KyeRussell commented 4 days ago

Python 3.9 support has been fixed in (unreleased) https://github.com/sphinx-doc/sphinx-autobuild/pull/157