-
Notifications
You must be signed in to change notification settings - Fork 2k
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
KeyError in parallel build with Sphinx 4.0.1 #9210
Comments
Seems related to #8935. |
In progress: it looks like on the line
|
In all the rest of the cases, the entries of Lines 83 to 103 in 778faff
I'd say that the |
This naïve patch fixed the issue: diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py
index f2a42f33f..fd6b307bc 100644
--- a/sphinx/ext/viewcode.py
+++ b/sphinx/ext/viewcode.py
@@ -150,7 +150,12 @@ def env_merge_info(app: Sphinx, env: BuildEnvironment, docnames: Iterable[str],
if modname not in env._viewcode_modules: # type: ignore
env._viewcode_modules[modname] = entry # type: ignore
else:
- used = env._viewcode_modules[modname][2] # type: ignore
+ try:
+ used = env._viewcode_modules[modname][2] # type: ignore
+ except TypeError:
+ # Entry is False, avoid `'bool' object is not subscriptable`
+ # see https://github.com/sphinx-doc/sphinx/issues/9210
+ continue
for fullname, docname in entry[2].items():
if fullname not in used:
used[fullname] = docname |
…d on parallel build
I posted #9212 to fix this. Can somebody try this? |
On it! |
@astrojuanlu Thank you for confirmation. Merging it. |
…d on parallel build
Fix #9210: viewcode: crashed if non importable modules found on parallel build
Thank you! |
Describe the bug
Sphinx build fails for astropy when we use Sphinx 4.0.1.
To Reproduce
See log in https://readthedocs.org/projects/astropy/builds/ , for example: https://readthedocs.org/projects/astropy/builds/13727660/
Expected behavior
Build is successful.
Your project
https://github.com/astropy/astropy/
Screenshots
N/A
Environment info
Additional context
The text was updated successfully, but these errors were encountered: