changeset: 103269:2b2e7b39bb68 user: Steve Dower date: Wed Sep 07 17:27:33 2016 -0700 files: Lib/encodings/__init__.py Misc/NEWS description: Issue #28005: Allow ImportErrors in encoding implementation to propagate. diff -r 15d79fcaf98c -r 2b2e7b39bb68 Lib/encodings/__init__.py --- a/Lib/encodings/__init__.py Thu Sep 08 01:25:04 2016 +0100 +++ b/Lib/encodings/__init__.py Wed Sep 07 17:27:33 2016 -0700 @@ -98,8 +98,9 @@ # module with side-effects that is not in the 'encodings' package. mod = __import__('encodings.' + modname, fromlist=_import_tail, level=0) - except ImportError: - pass + except ModuleNotFoundError as ex: + if ex.name != 'encodings.' + modname: + raise else: break else: diff -r 15d79fcaf98c -r 2b2e7b39bb68 Misc/NEWS --- a/Misc/NEWS Thu Sep 08 01:25:04 2016 +0100 +++ b/Misc/NEWS Wed Sep 07 17:27:33 2016 -0700 @@ -99,6 +99,8 @@ Library ------- +- Issue #28005: Allow ImportErrors in encoding implementation to propagate. + - Issue #27570: Avoid zero-length memcpy() etc calls with null source pointers in the "ctypes" and "array" modules.