]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Bug #1446043: correctly raise a LookupError if an encoding name given
authorGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 11:22:31 +0000 (11:22 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 11:22:31 +0000 (11:22 +0000)
to encodings.search_function() contains a dot.
 (backport from rev. 52075)

Lib/encodings/__init__.py
Misc/NEWS

index d2e952343fa4e994a1ca0e873285abcd87251dac..cdcfbe0bd045e5a9aaa0ac0414b1d98267e050be 100644 (file)
@@ -89,7 +89,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__(modname,
index 69d75604a79c144a3c98e27d0551216cc8b2f73c..ca2ac00605f2a19207a87b20964871f9082b1f96 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -122,6 +122,9 @@ Extension Modules
 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.