Hello,
after upgrading to docutils 0.22, building documentation for the pmbootstrap project fails:
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/sphinx/cmd/build.py", line 432, in build_main
app.build(args.force_all, args.filenames)
File "/usr/lib/python3.12/site-packages/sphinx/application.py", line 426, in build
self.builder.build_update()
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 375, in build_update
self.build(
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 403, in build
updated_docnames = set(self.read())
^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 519, in read
self._read_serial(docnames)
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 584, in _read_serial
self.read_doc(docname)
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 648, in read_doc
publisher.publish()
File "/usr/lib/python3.12/site-packages/docutils/core.py", line 269, in publish
self.document = self.reader.read(self.source, self.parser,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/sphinx/io.py", line 103, in read
self.parse()
File "/usr/lib/python3.12/site-packages/docutils/readers/__init__.py", line 101, in parse
self.parser.parse(self.input, document)
File "/usr/lib/python3.12/site-packages/sphinx/parsers.py", line 86, in parse
self.statemachine.run(inputlines, document, inliner=self.inliner)
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 165, in run
results = StateMachineWS.run(self, input_lines, input_offset,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py", line 235, in run
context, next_state, result = self.check_line(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py", line 447, in check_line
return method(match, context, next_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 2354, in explicit_markup
nodelist, blank_finish = self.explicit_construct(match)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 2366, in explicit_construct
return method(self, expmatch)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 2103, in directive
return self.run_directive(
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 2153, in run_directive
result = directive_instance.run()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/sphinxcontrib/autoprogram.py", line 262, in run
nested_parse_with_titles(self.state, result, node)
File "/usr/lib/python3.12/site-packages/sphinx/util/nodes.py", line 378, in nested_parse_with_titles
ret = state.nested_parse(content, content_offset, node, match_titles=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 275, in nested_parse
state_machine.run(block, input_offset, memo=self.memo,
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 191, in run
results = StateMachineWS.run(self, input_lines, input_offset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py", line 235, in run
context, next_state, result = self.check_line(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py", line 447, in check_line
return method(match, context, next_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 2787, in underline
self.section(title, source, style, lineno - 1, messages)
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 321, in section
self.new_subsection(title, lineno, messages)
File "/usr/lib/python3.12/site-packages/docutils/parsers/rst/states.py", line 370, in new_subsection
self.parent += section_node
File "/usr/lib/python3.12/site-packages/docutils/nodes.py", line 736, in __radd__
return other + self.children
~~~~~~^~~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'
Source code:
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/
Tested with commit:
5927ff70b8d2468d5d0e2c978bc1fe30d036fd7f
Distribution:
Alpine Linux Edge
This looks like the problem reported in [bugs:#508].
Could you check the Sphinx log?
Do you use "autodoc" or similar extensions to extract docstrings?
Related
Bugs:
#508Last edit: Günter Milde 2025-08-08
Yes, we use "sphinx.ext.autodoc".
This is the output from Sphinx:
/tmp/sphinx-err-bysgrjop.log:
In this case, the problem seems to be an incompatibility with Sphinx contrib extension "autoprogram".
Can you please try with an updated repository version of Docutils?
Commit [r10200] should fix it.
Related
Commit: [r10200]
Last edit: Günter Milde 2025-08-12
This should be fixed in [r10227]. Could you re-try?
Related
Commit: [r10227]
Please try with Docutils 0.22.1.rc1.
Fixed in Docutils 0.22.1.
Please reopen if there are still problems.
Thank you for reporting and tests.