From: Georg Brandl Date: Sat, 30 Sep 2006 11:22:35 +0000 (+0000) Subject: Bug #1446043: correctly raise a LookupError if an encoding name given X-Git-Tag: v2.5.1c1~359 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1206a933cc0f485cc8764daba5564bf9677d8e02;p=python 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 ff05fb75f9..98ae2fae72 100644 --- a/Lib/encodings/__init__.py +++ b/Lib/encodings/__init__.py @@ -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, diff --git a/Misc/NEWS b/Misc/NEWS index 55ef60ff97..c3cf131c04 100644 --- 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.