Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0ecdd2

Browse files
committed
Issue #13722: Avoid silencing ImportErrors when initializing the codecs registry.
2 parents aa5c5c6 + 1b468af commit f0ecdd2

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
@@ -450,6 +450,9 @@ Core and Builtins
450450
Library
451451
-------
452452

453+
- Issue #13722: Avoid silencing ImportErrors when initializing the codecs
454+
registry.
455+
453456
- Issue #13781: Fix GzipFile bug that caused an exception to be raised when
454457
opening for writing using a fileobj returned by os.fdopen().
455458

Python/codecs.c

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

10421042
mod = PyImport_ImportModuleNoBlock("encodings");
10431043
if (mod == NULL) {
1044-
if (PyErr_ExceptionMatches(PyExc_ImportError)) {
1045-
/* Ignore ImportErrors... this is done so that
1046-
distributions can disable the encodings package. Note
1047-
that other errors are not masked, e.g. SystemErrors
1048-
raised to inform the user of an error in the Python
1049-
configuration are still reported back to the user. */
1050-
PyErr_Clear();
1051-
return 0;
1052-
}
10531044
return -1;
10541045
}
10551046
Py_DECREF(mod);

0 commit comments

Comments
 (0)