linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* docs: sphinx: avoid using the deprecated node.set_class()
@ 2025-06-19 21:26 Jonathan Corbet
  2025-06-20  2:22 ` Akira Yokosawa
  0 siblings, 1 reply; 9+ messages in thread
From: Jonathan Corbet @ 2025-06-19 21:26 UTC (permalink / raw)
  To: linux-doc; +Cc: Mauro Carvalho Chehab, Akira Yokosawa

Docutils emits a deprecation warning when the set_class() element method is
used; that warning disappears into the ether, but it also causes a crash
with docutils 0.19 when combined with certain versions of Sphinx.

Avoid the deprecated function and just append directly to the "classes"
attribute like the documentation says instead.

Reported-by: Akira Yokosawa <akiyks@gmail.com>
Fixes: d6d1df92c25f ("docs: automarkup: Mark up undocumented entities too")
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
TODO for the future: figure out where the warning is going

 Documentation/sphinx/automarkup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/sphinx/automarkup.py b/Documentation/sphinx/automarkup.py
index e67eb8e19c22..563033f764bb 100644
--- a/Documentation/sphinx/automarkup.py
+++ b/Documentation/sphinx/automarkup.py
@@ -240,7 +240,7 @@ def add_and_resolve_xref(app, docname, domain, reftype, target, contnode=None):
     # mark it as a broken xref
     #
     if contnode:
-        contnode.set_class("broken_xref")
+        contnode['classes'].append("broken_xref")
     return contnode
 
 #
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-06-20 19:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19 21:26 docs: sphinx: avoid using the deprecated node.set_class() Jonathan Corbet
2025-06-20  2:22 ` Akira Yokosawa
2025-06-20  7:44   ` Mauro Carvalho Chehab
2025-06-20 11:14     ` Akira Yokosawa
2025-06-20 13:05       ` Mauro Carvalho Chehab
2025-06-20 18:44         ` Mauro Carvalho Chehab
2025-06-20 19:54           ` Mauro Carvalho Chehab
2025-06-20 13:54   ` Jonathan Corbet
2025-06-20 14:36     ` Akira Yokosawa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).