summaryrefslogtreecommitdiffstats
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-04-12 21:41:50 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-04-12 21:41:50 (GMT)
commit4d65224f68c73373587c2ea69ac91ad6dd4fd95c (patch)
treeded8d3a223d200515c770775cf429082eb41baab /Lib/pydoc.py
parentea4b46f9a9056de25a3e368aa458c7dd94c853bf (diff)
downloadcpython-4d65224f68c73373587c2ea69ac91ad6dd4fd95c.zip
cpython-4d65224f68c73373587c2ea69ac91ad6dd4fd95c.tar.gz
cpython-4d65224f68c73373587c2ea69ac91ad6dd4fd95c.tar.bz2
Issue #11186: pydoc ignores a module if its name contains a surrogate character
in the index of modules.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 739b440..8e14ee7 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -952,6 +952,9 @@ class HTMLDoc(Doc):
modpkgs = []
if shadowed is None: shadowed = {}
for importer, name, ispkg in pkgutil.iter_modules([dir]):
+ if any((0xD800 <= ord(ch) <= 0xDFFF) for ch in name):
+ # ignore a module if its name contains a surrogate character
+ continue
modpkgs.append((name, '', ispkg, name in shadowed))
shadowed[name] = 1