]> granicus.if.org Git - python/commitdiff
Issue #11186: pydoc ignores a module if its name contains a surrogate character
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 12 Apr 2011 21:41:50 +0000 (23:41 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 12 Apr 2011 21:41:50 +0000 (23:41 +0200)
in the index of modules.

Lib/pydoc.py
Misc/NEWS

index 739b440696a456490dc638021a7095bf3a22c814..8e14ee757df136c864dbf1a61716ce910961adc9 100755 (executable)
@@ -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
 
index 25dfd910c81ec81d1d11cfd9ddd64df18ff9736b..9a12912e8aaa4eafdaee8541913c8a1dc9616563 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -103,6 +103,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #11186: pydoc ignores a module if its name contains a surrogate
+  character in the index of modules.
+
 - Issue #11815: Use a light-weight SimpleQueue for the result queue in
   concurrent.futures.ProcessPoolExecutor.