python / python-docs-theme

Sphinx theme for Python documentation
Other
75 stars 58 forks source link

Theme broken with Sphinx 7.1.0 #136

Closed ThimoNeubauer closed 1 year ago

ThimoNeubauer commented 1 year ago

Since the release of Sphinx 7.1.0 we've been seeing

Theme error:
An error happened in rendering the page index.
Reason: OSError(22, 'Invalid argument')

in many of our projects. We're using the "python-docs-theme". Here's an (abbreviated) log of a minimal reproducer:

PS E:\temp> py -3 -m virtualenv Sphinx
created virtual environment CPython3.11.4.final.0-64 in 764ms
  creator CPython3Windows(dest=E:\temp\Sphinx, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\TNR1\AppData\Local\pypa\virtualenv)
    added seed packages: pip==23.0.1, setuptools==67.6.0, wheel==0.40.0
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
PS E:\temp> .\Sphinx\Scripts\pip install sphinx python-docs-theme
Collecting sphinx
  Using cached sphinx-7.1.0-py3-none-any.whl (3.2 MB)
Collecting python-docs-theme
  Using cached python_docs_theme-2023.5-py3-none-any.whl (17 kB)

... blah blah blah ...

PS E:\temp> cd .\Sphinx\
PS E:\temp\Sphinx> .\Scripts\sphinx-quickstart.exe --sep --project foo --author foo --quiet

Finished: An initial directory structure has been created.

You should now populate your master file E:\temp\Sphinx\source\index.rst and create other documentation
source files. Use the Makefile to build the docs, like so:
   make builder
where "builder" is one of the supported builders, e.g. html, latex or linkcheck.

PS E:\temp\Sphinx> .\Scripts\sphinx-build.exe -D html_theme=python_docs_theme source build
Running Sphinx v7.1.0
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets... copying static files... done
copying extra files... done
done
writing output... [100%] index
Theme error:
An error happened in rendering the page index.
Reason: OSError(22, 'Invalid argument')
PS E:\temp\Sphinx>

I first reported this as Sphinx issue. There I was pointed to a very similar issue in which it was concluded that the theme code needs to be changed. I guess that a similar fix is required here...?

m-aciek commented 1 year ago

Presumably it's connected with https://github.com/python/python-docs-theme/pull/108.