Issue #11186: pydoc ignores a module if its name contains a surrogate character
in the index of modules.
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 @@
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