From a92979a1db11ca42e78390fead218afbefb61587 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 30 Sep 2006 11:22:28 +0000 Subject: Bug #1446043: correctly raise a LookupError if an encoding name given to encodings.search_function() contains a dot. --- Lib/encodings/__init__.py | 2 +- Misc/NEWS | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py index 82e517a..6cf6089 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 3cbb01c..e3abddc 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -63,6 +63,9 @@ Core and builtins 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. -- cgit v0.12