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
Running rediraffecheckdiff on a Sphinx setup where rediraffe_redirects is set to an empty dict in conf.py results in an AttributeError: 'NoneType' object has no attribute 'open' that looks to come from rediraffe assuming rediraffe_redirects is a file (despite documentation and source indicating that both files and dicts should be supported)
Specifically:
$ grep --after-context=1 ^rediraffe source/conf.py
rediraffe_branch = "main"
rediraffe_redirects = {
}
$ pipenv run sphinx-build -b=rediraffecheckdiff source build -W --keep-going -E -v
Running Sphinx v7.2.6
Initializing Spelling Checker 8.0.0
locale_dir /Users/doismellburning/git/tech-docs/source/locales/en/LC_MESSAGES does not exist
Traceback (most recent call last):
File "/Users/doismellburning/.local/share/virtualenvs/tech-docs-26HPyE37/lib/python3.9/site-packages/sphinx/cmd/build.py", line 293, in build_main
app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
File "/Users/doismellburning/.local/share/virtualenvs/tech-docs-26HPyE37/lib/python3.9/site-packages/sphinx/application.py", line 272, in __init__
self._init_builder()
File "/Users/doismellburning/.local/share/virtualenvs/tech-docs-26HPyE37/lib/python3.9/site-packages/sphinx/application.py", line 342, in _init_builder
self.builder.init()
File "/Users/doismellburning/.local/share/virtualenvs/tech-docs-26HPyE37/lib/python3.9/site-packages/sphinxext/rediraffe.py", line 386, in init
with redirects_path.open("a") as redirects_file:
AttributeError: 'NoneType' object has no attribute 'open'
[snip]
Running
rediraffecheckdiff
on a Sphinx setup whererediraffe_redirects
is set to an empty dict inconf.py
results in anAttributeError: 'NoneType' object has no attribute 'open'
that looks to come from rediraffe assumingrediraffe_redirects
is a file (despite documentation and source indicating that both files and dicts should be supported)Specifically:
It looks like there's logic at https://github.com/wpilibsuite/sphinxext-rediraffe/blob/v0.2.7/sphinxext/rediraffe.py#L301-L302 to check for if the config is a
dict
, but then later https://github.com/wpilibsuite/sphinxext-rediraffe/blob/v0.2.7/sphinxext/rediraffe.py#L386 just assumes there's a file to be openedThe text was updated successfully, but these errors were encountered: