changeset 39940:dfd809dcf680 2.5

Bug #1446043: correctly raise a LookupError if an encoding name given to encodings.search_function() contains a dot. (backport from rev. 52075)
author Georg Brandl <georg@python.org>
date Sat, 30 Sep 2006 11:22:35 +0000
parents cf58fb8450ba
children 90728dfc33e8
files Lib/encodings/__init__.py Misc/NEWS
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/encodings/__init__.py	Sat Sep 30 11:17:43 2006 +0000
+++ b/Lib/encodings/__init__.py	Sat Sep 30 11:22:35 2006 +0000
@@ -90,7 +90,7 @@
     else:
         modnames = [norm_encoding]
     for modname in modnames:
-        if not modname:
+        if not modname or '.' in modname:
             continue
         try:
             mod = __import__('encodings.' + modname,
--- a/Misc/NEWS	Sat Sep 30 11:17:43 2006 +0000
+++ b/Misc/NEWS	Sat Sep 30 11:22:35 2006 +0000
@@ -44,6 +44,9 @@
 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.