From: Mauro Carvalho Chehab Date: Thu, 19 Jun 2025 12:55:33 +0000 (+0200) Subject: docs: parser_yaml.py: fix backward compatibility with old docutils X-Git-Tag: v6.18-rc1~107^2~90^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d90555ef0603935529837e490d5acc8436297c56;p=thirdparty%2Flinux.git docs: parser_yaml.py: fix backward compatibility with old docutils 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 Closes: https://lore.kernel.org/linux-doc/598b2cb7-2fd7-4388-96ba-2ddf0ab55d2a@gmail.com/ Tested-by: Akira Yokosawa Signed-off-by: Mauro Carvalho Chehab --- diff --git a/Documentation/sphinx/parser_yaml.py b/Documentation/sphinx/parser_yaml.py index 8288e2ff7c7cd..1602b31f448e7 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)