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
{{ message }}
Repository navigation
Sphinx 7.1 breaks Furo's usage of css_tag(css) on Windows #11518
The 7.1.0 release is breaking the Furo theme; css_tag(css) is causing a file to be attempted to be opened with ?digest=e6660623a769aa55fea372102b9bf3151b292993 added to it, which of course breaks.
File "D:\a\scikit-build-core\scikit-build-core\.nox\docs\Lib\site-packages\furo\theme\furo\base.html", line 62, in block 'regular_styles'
{{ css_tag(css) }}
File "D:\a\scikit-build-core\scikit-build-core\.nox\docs\Lib\site-packages\jinja2\sandbox.py", line 393, in callreturn __context.call(__obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\a\scikit-build-core\scikit-build-core\.nox\docs\Lib\site-packages\sphinx\builders\html\__init__.py", line 1202, in css_tagif checksum := _file_checksum(app.outdir, css.filename):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\a\scikit-build-core\scikit-build-core\.nox\docs\Lib\site-packages\sphinx\builders\html\__init__.py", line 1254, in _file_checksumwithopen(path.join(outdir, filename), encoding='utf-8') as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^OSError: [Errno 22] Invalid argument: 'D:\\a\\scikit-build-core\\scikit-build-core\\docs\\_build\\html\\_static/styles/furo.css?digest=e6660623a769aa55fea372102b9bf3151b292993'
If it's @pradyunsg's Furo's fault, I can open an issue there instead, but this looks like it's an issue with the checksum additions mentioned for 7.1.0? Especially since it only happens on Windows.
It's hard for me to test, since it's Windows only. Building Scikit-build-core's docs (via nox) on Windows would repeat it. I think any usage of Furo would break it, it doesn't seem to be specific, as it's loading a css file. Maybe other themes that have this construct.
Environment Information
GitHub Actions, windows-latest, with the latest sphinx.
This is a problem with Furo, it seems -- css.filename must be a local file or a URI, and Furo seems to have used a workaround to achieve a similar feature via using an invalid filename (appending the checksum earlier), which Sphinx didn't previously check.
As such I don't think I consider this a breaking change in Sphinx. Sorry not to be more helpful.
Can confirm that I can't build the matplotlib docs anymore either, which means it's also breaking pydata-sphinx, and downgrading to 7.0 removes this error.
OSError: [Errno 22] Invalid argument: 'C:\\Users\\story\\Projects\\matplotlib\\doc\\build\\html\\_static/pygments.css?v3.7.1-2022-g9676e766d4-dirty'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\story\miniconda3\envs\mpl-dev\Lib\site-packages\sphinx\cmd\build.py", line 290, in build_main
app.build(args.force_all, args.filenames)
File "C:\Users\story\miniconda3\envs\mpl-dev\Lib\site-packages\sphinx\application.py", line 351, in buildself.builder.build_update()
File "C:\Users\story\miniconda3\envs\mpl-dev\Lib\site-packages\sphinx\builders\__init__.py", line 290, in build_updateself.build(to_build,
File "C:\Users\story\miniconda3\envs\mpl-dev\Lib\site-packages\sphinx\builders\__init__.py", line 360, in buildself.write(docnames, list(updated_docnames), method)
File "C:\Users\story\miniconda3\envs\mpl-dev\Lib\site-packages\sphinx\builders\__init__.py", line 567, in writeself._write_serial(sorted(docnames))
File "C:\Users\story\miniconda3\envs\mpl-dev\Lib\site-packages\sphinx\builders\__init__.py", line 577, in _write_serialself.write_doc(docname, doctree)
File "C:\Users\story\miniconda3\envs\mpl-dev\Lib\site-packages\sphinx\builders\html\__init__.py", line 675, in write_docself.handle_page(docname, ctx, event_arg=doctree)
File "C:\Users\story\miniconda3\envs\mpl-dev\Lib\site-packages\sphinx\builders\html\__init__.py", line 1105, in handle_pageraise ThemeError(__("An error happened in rendering the page %s.\nReason: %r") %sphinx.errors.ThemeError: An error happened in rendering the page api/_api_api.Reason: OSError(22, 'Invalid argument')
Activity
AA-Turner commentedon Jul 26, 2023
This is a problem with Furo, it seems --
css.filenamemust be a local file or a URI, and Furo seems to have used a workaround to achieve a similar feature via using an invalid filename (appending the checksum earlier), which Sphinx didn't previously check.As such I don't think I consider this a breaking change in Sphinx. Sorry not to be more helpful.
A
henryiii commentedon Jul 26, 2023
Ahh, it must be https://github.com/pradyunsg/furo/blob/f8db95bed5d1c57b4ea6bf536c65560fa9ae33a9/src/furo/__init__.py#L149-L153 then. Thanks! Will open an issue there.
pradyunsg commentedon Jul 26, 2023
FWIW, it isn't limited to Furo -- at least one more theme is broken by this change. :)
story645 commentedon Aug 10, 2023
Can confirm that I can't build the matplotlib docs anymore either, which means it's also breaking pydata-sphinx, and downgrading to 7.0 removes this error.
pradyunsg commentedon Aug 10, 2023
Consider reporting that to pydata-sphinx-theme?
AA-Turner commentedon Aug 11, 2023
@story645 I can't reproduce that failure, please may you open a new issue or provide the command that you ran?I managed to reproduce; please see matplotlib/matplotlib#26493 for a proposed fix.
A
pradyunsg commentedon Aug 11, 2023
@AA-Turner Do you think it's worth improving the error message in this case?
AA-Turner commentedon Aug 11, 2023
Done in 44a7820, thank you for the suggestion.
A
pradyunsg commentedon Aug 12, 2023
Awesome, thanks for the quick change! :)