[PATCH v10 13/14] docs: parser_yaml.py: fix backward compatibility with old docutils
Mauro Carvalho Chehab <[email protected]> Mon, 28 Jul 2025 18:02:06 +0200
| Newsgroups | dev.linux.lists.lkmm,dev.linux.lists.linux-kernel-mentees,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <9715e41c91302e2b8a9baf349903f3fcff726295.1753718185.git.mchehab+huawei@kernel.org> |
As reported by Akira, older docutils versions are not compatible with the way some Sphinx versions send tab_width. Add a code to address it. Reported-by: Akira Yokosawa <[email protected]> Closes: https://lore.kernel.org/linux-doc/[email protected]/ Tested-by: Akira Yokosawa <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> --- Documentation/sphinx/parser_yaml.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/sphinx/parser_yaml.py b/Documentation/sphinx/parser_yaml.py index 8288e2ff7c7c..1602b31f448e 100755 --- a/Documentation/sphinx/parser_yaml.py +++ b/Documentation/sphinx/parser_yaml.py @@ -77,6 +77,10 @@ class YamlParser(Parser): result.append(line, document.current_source, lineoffset) + # Fix backward compatibility with docutils < 0.17.1 + if "tab_width" not in vars(document.settings): + document.settings.tab_width = 8 + rst_parser = RSTParser() rst_parser.parse('\n'.join(result), document) -- 2.49.0