Skip to content

Commit 1b468af

Browse files
committed
Issue #13722: Avoid silencing ImportErrors when initializing the codecs registry.
1 parent 55f217f commit 1b468af

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ Core and Builtins
103103
Library
104104
-------
105105

106+
- Issue #13722: Avoid silencing ImportErrors when initializing the codecs
107+
registry.
108+
106109
- Issue #13781: Fix GzipFile bug that caused an exception to be raised when
107110
opening for writing using a fileobj returned by os.fdopen().
108111

Python/codecs.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,15 +1067,6 @@ static int _PyCodecRegistry_Init(void)
10671067

10681068
mod = PyImport_ImportModuleNoBlock("encodings");
10691069
if (mod == NULL) {
1070-
if (PyErr_ExceptionMatches(PyExc_ImportError)) {
1071-
/* Ignore ImportErrors... this is done so that
1072-
distributions can disable the encodings package. Note
1073-
that other errors are not masked, e.g. SystemErrors
1074-
raised to inform the user of an error in the Python
1075-
configuration are still reported back to the user. */
1076-
PyErr_Clear();
1077-
return 0;
1078-
}
10791070
return -1;
10801071
}
10811072
Py_DECREF(mod);

0 commit comments

Comments
 (0)