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

Build failure if Docutils version is 0.18 (not 0.18.1) due to missing Node.findall() #10596

Closed
jfbu opened this issue Jun 25, 2022 · 1 comment
Labels
Milestone

Comments

@jfbu
Copy link
Contributor

jfbu commented Jun 25, 2022

Describe the bug

Exception occurred:
  File "/Users/path/to/sphinx/sphinx/transforms/__init__.py", line 204, in apply
    for node in self.document.findall():  # type: Node
AttributeError: 'document' object has no attribute 'findall'

How to Reproduce

pip install docutils==0.18

then attempt make html on any Sphinx project.

Expected behavior

No error

Your project

any

Screenshots

No response

OS

Mac

Python version

3.10.4

Sphinx version

Sphinx v5.1.0+/1786e989c

Sphinx extensions

No response

Extra tools

No response

Additional context

#10044 prepared the migration. But the Docutils 0.18 (which does not have Nodes.findall() ) is not detected:

# Node.findall() is a new interface to traverse a doctree since docutils-0.18.
# This applies a patch docutils-0.17 or older to be available Node.findall()
# method to use it from our codebase.
if docutils.__version_info__ < (0, 18):
def findall(self, *args, **kwargs):
return iter(self.traverse(*args, **kwargs))
Node.findall = findall # type: ignore

The Docutils revision 8885 is part of Docutils 0.18.1 not of 0.18.

People with Docutils version exactly at 0.18 (which is available on pypi) and Sphinx 4.4.0 and later will encounter the problem. Perhaps very few people will be in this situation, as 0.18.1 was released about one month after 0.18.

@jfbu jfbu added the type:bug label Jun 25, 2022
@jfbu jfbu added this to the 5.0.3 milestone Jun 25, 2022
jfbu added a commit to jfbu/sphinx that referenced this issue Jun 25, 2022
…0.18.1)

Node.findall() was added only at Docutils 0.18.1
@AA-Turner
Copy link
Member

Closed in #10597

A

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

No branches or pull requests

2 participants