From ba9508988f93f1fbc9b3bee47ced40adb7e7d274 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 27 Jan 2022 14:42:50 +0300 Subject: [PATCH 1/2] bpo-46547: remove leaking vars into `pydoc.Helper` namespace --- Lib/pydoc.py | 1 + .../NEWS.d/next/Library/2022-01-27-14-41-55.bpo-46547.JMyYz9.rst | 1 + 2 files changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2022-01-27-14-41-55.bpo-46547.JMyYz9.rst diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 7d52359c9a0ce94..b2dc0f248178c62 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1880,6 +1880,7 @@ class Helper: if topic not in topics: topics = topics + ' ' + topic symbols[symbol] = topics + # del topic, symbols_, symbol, topics topics = { 'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS ' diff --git a/Misc/NEWS.d/next/Library/2022-01-27-14-41-55.bpo-46547.JMyYz9.rst b/Misc/NEWS.d/next/Library/2022-01-27-14-41-55.bpo-46547.JMyYz9.rst new file mode 100644 index 000000000000000..83065a7a06030d1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-01-27-14-41-55.bpo-46547.JMyYz9.rst @@ -0,0 +1 @@ +Remove variables leaking into ``pydoc.Helper`` class namespace. From b2818360f3c993c3698d3af8a2326f6cb136e492 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 27 Jan 2022 15:06:13 +0300 Subject: [PATCH 2/2] Update pydoc.py --- Lib/pydoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index b2dc0f248178c62..3d043de13f05ea8 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1880,7 +1880,7 @@ class Helper: if topic not in topics: topics = topics + ' ' + topic symbols[symbol] = topics - # del topic, symbols_, symbol, topics + del topic, symbols_, symbol, topics topics = { 'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS '