Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The ``encodings.latin_1`` module is no longer imported at startup. Now it is
only imported when it is the filesystem encoding or the stdio encoding.
13 changes: 0 additions & 13 deletions Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,6 @@ static PyStatus
init_sys_streams(PyThreadState *tstate)
{
PyObject *iomod = NULL;
PyObject *m;
PyObject *std = NULL;
int fd;
PyObject * encoding_attr;
Expand All @@ -1959,18 +1958,6 @@ init_sys_streams(PyThreadState *tstate)
}
#endif

/* Hack to avoid a nasty recursion issue when Python is invoked
in verbose mode: pre-import the Latin-1 and UTF-8 codecs */
if ((m = PyImport_ImportModule("encodings.utf_8")) == NULL) {
goto error;
}
Py_DECREF(m);

if (!(m = PyImport_ImportModule("encodings.latin_1"))) {
goto error;
}
Py_DECREF(m);

if (!(iomod = PyImport_ImportModule("io"))) {
goto error;
}
Expand Down