File tree Expand file tree Collapse file tree 2 files changed +2
-13
lines changed
Misc/NEWS.d/next/Core and Builtins Expand file tree Collapse file tree 2 files changed +2
-13
lines changed Original file line number Diff line number Diff line change
1
+ The ``encodings.latin_1 `` module is no longer imported at startup. Now it is
2
+ only imported when it is the filesystem encoding or the stdio encoding.
Original file line number Diff line number Diff line change @@ -1939,7 +1939,6 @@ static PyStatus
1939
1939
init_sys_streams (PyThreadState * tstate )
1940
1940
{
1941
1941
PyObject * iomod = NULL ;
1942
- PyObject * m ;
1943
1942
PyObject * std = NULL ;
1944
1943
int fd ;
1945
1944
PyObject * encoding_attr ;
@@ -1959,18 +1958,6 @@ init_sys_streams(PyThreadState *tstate)
1959
1958
}
1960
1959
#endif
1961
1960
1962
- /* Hack to avoid a nasty recursion issue when Python is invoked
1963
- in verbose mode: pre-import the Latin-1 and UTF-8 codecs */
1964
- if ((m = PyImport_ImportModule ("encodings.utf_8" )) == NULL ) {
1965
- goto error ;
1966
- }
1967
- Py_DECREF (m );
1968
-
1969
- if (!(m = PyImport_ImportModule ("encodings.latin_1" ))) {
1970
- goto error ;
1971
- }
1972
- Py_DECREF (m );
1973
-
1974
1961
if (!(iomod = PyImport_ImportModule ("io" ))) {
1975
1962
goto error ;
1976
1963
}
You can’t perform that action at this time.
0 commit comments