From: Georg Brandl Date: Sat, 30 Sep 2006 11:22:31 +0000 (+0000) Subject: Bug #1446043: correctly raise a LookupError if an encoding name given X-Git-Tag: v2.4.4c1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cae0a86962c8100f582bd3c5e0e1182dba3be781;p=thirdparty%2FPython%2Fcpython.git Bug #1446043: correctly raise a LookupError if an encoding name given to encodings.search_function() contains a dot. (backport from rev. 52075) --- diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py index d2e952343fa4..cdcfbe0bd045 100644 --- a/Lib/encodings/__init__.py +++ b/Lib/encodings/__init__.py @@ -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, diff --git a/Misc/NEWS b/Misc/NEWS index 69d75604a79c..ca2ac00605f2 100644 --- 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.