]> 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:35 +0000 (11:22 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 30 Sep 2006 11:22:35 +0000 (11:22 +0000)
to encodings.search_function() contains a dot.
 (backport from rev. 52075)

Lib/encodings/__init__.py
Misc/NEWS

index ff05fb75f987b60e108db23d8759fc052dc4acd2..98ae2fae72960bf7692fa04c22f587dcb0148106 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 55ef60ff973822441e435f1778deace2b65e3bd7..c3cf131c0472fbb85d50e220742ec6d884a4f90c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -44,6 +44,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.