Skip to content
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

Fix AliasNode.copy() #8520

Closed
wants to merge 2 commits into from
Closed

Conversation

bnavigator
Copy link
Contributor

Feature or Bugfix

  • Bugfix

Purpose

The changed args in the constructor are not reflected in the copy function.

In the openSUSE build this manifests when building Sphinx' own docs as manpages with the very unspecific error message:

[  208s] writing... sphinx-all.1 { usage/index usage/quickstart usage/installation usage/restructuredtext/index usage/restructuredtext/basics usage/restructuredtext/roles usage/restructuredtext/directives usage/restructuredtext/field-lists usage/restructuredtext/domains failed
[  208s] 
[  208s] Warning, treated as error:
[  208s] /home/abuild/rpmbuild/BUILD/Sphinx-3.3.1/doc/contents.rst:toctree contains ref to nonexisting file 'usage/index'

With -vvv I managed to observe the relevant backtrace:

[   30s] looking for now-outdated files... [app] emitting event: 'env-get-updated'(<sphinx.environment.BuildEnvironment object at 0x7f99ab401b00>,)
[   30s] none found
[   31s] writing... sphinx-all.1 { usage/index usage/quickstart usage/installation usage/restructuredtext/index usage/restructuredtext/basics usage/restructuredtext/roles usage/restructuredtext/directives usage/restructuredtext/field-lists usage/restructuredtext/domains failed
[   31s] [app] emitting event: 'build-finished'(SphinxWarning("/home/abuild/rpmbuild/BUILD/Sphinx-3.3.1/doc/contents.rst:toctree contains ref to no
[   31s] 
[   31s] Traceback (most recent call last):
[   31s]   File "/home/abuild/rpmbuild/BUILD/Sphinx-3.3.1/sphinx/util/nodes.py", line 426, in inline_all_toctrees
[   31s]     colorfunc, traversed)
[   31s]   File "/home/abuild/rpmbuild/BUILD/Sphinx-3.3.1/sphinx/util/nodes.py", line 415, in inline_all_toctrees
[   31s]     tree = cast(nodes.document, tree.deepcopy())
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in deepcopy
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in <listcomp>
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in deepcopy
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in <listcomp>
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in deepcopy
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in <listcomp>
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in deepcopy
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in <listcomp>
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in deepcopy
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in <listcomp>
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in deepcopy
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in <listcomp>
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in deepcopy
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1074, in <listcomp>
[   31s]     copy.extend([child.deepcopy() for child in self.children])
[   31s]   File "/usr/lib/python3.6/site-packages/docutils/nodes.py", line 1073, in deepcopy
[   31s]     copy = self.copy()
[   31s]   File "/home/abuild/rpmbuild/BUILD/Sphinx-3.3.1/sphinx/domains/c.py", line 3460, in copy
[   31s]     return self.__class__(self.sig, env=None, parentKey=self.parentKey)  # type: ignore
[   31s] TypeError: __init__() missing 2 required positional arguments: 'maxdepth' and 'document'
[   31s] 

sphinx/domains/c.py Outdated Show resolved Hide resolved
@jakobandersen
Copy link
Contributor

jakobandersen commented Dec 12, 2020

Thanks, looks good. I have rebased it to the 3.3.x branch along with a couple of extra commits (#8530). The fix will then be in v3.3.2, or be folded into 3.4.0 if you don't find it too critical.

@bnavigator
Copy link
Contributor Author

That's fine. Until this lands in a release, we apply the patch manually.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants