]> granicus.if.org Git - python/commitdiff
Bug #1446043: correctly raise a LookupError if an encoding name given
authorGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 11:22:28 +0000 (11:22 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 11:22:28 +0000 (11:22 +0000)
to encodings.search_function() contains a dot.

Lib/encodings/__init__.py
Misc/NEWS

index 82e517a774c91f36520819526d058a5fee7601e0..6cf608954ccd8e0e3e0559524d57e6b9edfa42de 100644 (file)
@@ -90,7 +90,7 @@ def search_function(encoding):
     else:
         modnames = [norm_encoding]
     for modname in modnames:
-        if not modname:
+        if not modname or '.' in modname:
             continue
         try:
             mod = __import__('encodings.' + modname,
index 3cbb01cdea02e939f5d82e3a401c225d7b1dd5f3..e3abddcfd9c511924499e2acbad797aecb1b78fe 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -63,6 +63,9 @@ Core and builtins
 Library
 -------
 
+- Bug #1446043: correctly raise a LookupError if an encoding name given
+  to encodings.search_function() contains a dot.
+
 - Bug #1560617: in pyclbr, return full module name not only for classes,
   but also for functions.