linux/Documentation/sphinx
Akira Yokosawa d43ddd5c91 docs: kernel_include.py: Cope with docutils 0.21
Running "make htmldocs" on a newly installed Sphinx 7.3.7 ends up in
a build error:

    Sphinx parallel build error:
    AttributeError: module 'docutils.nodes' has no attribute 'reprunicode'

docutils 0.21 has removed nodes.reprunicode, quote from release note [1]:

  * Removed objects:

    docutils.nodes.reprunicode, docutils.nodes.ensure_str()
        Python 2 compatibility hacks

Sphinx 7.3.0 supports docutils 0.21 [2]:

kernel_include.py, whose origin is misc.py of docutils, uses reprunicode.

Upstream docutils removed the offending line from the corresponding file
(docutils/docutils/parsers/rst/directives/misc.py) in January 2022.
Quoting the changelog [3]:

    Deprecate `nodes.reprunicode` and `nodes.ensure_str()`.

    Drop uses of the deprecated constructs (not required with Python 3).

Do the same for kernel_include.py.

Tested against:
  - Sphinx 2.4.5 (docutils 0.17.1)
  - Sphinx 3.4.3 (docutils 0.17.1)
  - Sphinx 5.3.0 (docutils 0.18.1)
  - Sphinx 6.2.1 (docutils 0.19)
  - Sphinx 7.2.6 (docutils 0.20.1)
  - Sphinx 7.3.7 (docutils 0.21.2)

Link: http://www.docutils.org/RELEASE-NOTES.html#release-0-21-2024-04-09 [1]
Link: https://www.sphinx-doc.org/en/master/changes.html#release-7-3-0-released-apr-16-2024 [2]
Link: https://github.com/docutils/docutils/commit/c8471ce47a24 [3]
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/faf5fa45-2a9d-4573-9d2e-3930bdc1ed65@gmail.com
2024-05-02 09:50:59 -06:00
..
templates docs/sphinx: Fix TOC scroll hack for the home page 2024-01-23 14:33:13 -07:00
automarkup.py
cdomain.py
kernel_abi.py
kernel_feat.py docs: kernel_feat.py: fix build error for missing files 2024-02-21 13:44:21 -07:00
kernel_include.py docs: kernel_include.py: Cope with docutils 0.21 2024-05-02 09:50:59 -06:00
kerneldoc-preamble.sty docs: Detect variable fonts and suggest denylisting them 2024-04-10 14:10:13 -06:00
kerneldoc.py doc: kerneldoc.py: fix indentation 2024-02-21 13:44:21 -07:00
kernellog.py
kfigure.py
load_config.py
maintainers_include.py
parallel-wrapper.sh
parse-headers.pl
requirements.txt docs: drop the version constraints for sphinx and dependencies 2024-03-03 08:17:20 -07:00
rstFlatTable.py
translations.py docs: translations: use attribute to store current language 2024-02-21 13:41:37 -07:00