https://github.com/python/cpython/commit/c6c2071cab39643d40d3ea0f666ef9c50beb4d31
commit: c6c2071cab39643d40d3ea0f666ef9c50beb4d31
branch: 3.13
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: AA-Turner <9087854+aa-tur...@users.noreply.github.com>
date: 2025-02-27T14:25:30Z
summary:

[3.13] Doc: Strip trailing whitespace in ``pydoc_topics`` (GH-130492) (#130635)

(cherry picked from commit 3f3e1c4095ae229b0c6d0364f289a20732281a96)

Co-authored-by: Adam Turner <9087854+aa-tur...@users.noreply.github.com>

files:
M Doc/tools/extensions/pydoc_topics.py

diff --git a/Doc/tools/extensions/pydoc_topics.py 
b/Doc/tools/extensions/pydoc_topics.py
index 6e43df2e4bf9de..0f3dfacd4f2f87 100644
--- a/Doc/tools/extensions/pydoc_topics.py
+++ b/Doc/tools/extensions/pydoc_topics.py
@@ -143,7 +143,8 @@ def write_documents(self, _docnames: Set[str]) -> None:
                 document.append(doc_ids[label_id])
                 visitor = TextTranslator(document, builder=self)
                 document.walkabout(visitor)
-                self.topics[topic_label] = visitor.body
+                body = "\n".join(map(str.rstrip, visitor.body.splitlines()))
+                self.topics[topic_label] = body
 
     def finish(self) -> None:
         topics_repr = "\n".join(

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to