summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-09-30 11:22:35 (GMT)
committerGeorg Brandl <georg@python.org>2006-09-30 11:22:35 (GMT)
commit1206a933cc0f485cc8764daba5564bf9677d8e02 (patch)
treeabfcdc83a8ec496787900c0bb0954d428b6aaaee
parent6d7c36332f3ad9a2214ef9531ea0d5dc0cb9c765 (diff)
downloadcpython-1206a933cc0f485cc8764daba5564bf9677d8e02.zip
cpython-1206a933cc0f485cc8764daba5564bf9677d8e02.tar.gz
cpython-1206a933cc0f485cc8764daba5564bf9677d8e02.tar.bz2
Bug #1446043: correctly raise a LookupError if an encoding name given
to encodings.search_function() contains a dot. (backport from rev. 52075)
-rw-r--r--Lib/encodings/__init__.py2
-rw-r--r--Misc/NEWS3
2 files changed, 4 insertions, 1 deletions
diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py
index ff05fb7..98ae2fa 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 55ef60f..c3cf131 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.