@@ -439,7 +439,7 @@ unicode_check_encoding_errors(const char *encoding, const char *errors)
439439 PyInterpreterState * interp = _PyInterpreterState_GET_UNSAFE ();
440440#ifndef Py_DEBUG
441441 /* In release mode, only check in development mode (-X dev) */
442- if (!interp -> config . dev_mode ) {
442+ if (!_PyInterpreterState_GetConfig ( interp ) -> dev_mode ) {
443443 return 0 ;
444444 }
445445#else
@@ -3632,7 +3632,8 @@ PyUnicode_EncodeFSDefault(PyObject *unicode)
36323632 /* Before _PyUnicode_InitEncodings() is called, the Python codec
36333633 machinery is not ready and so cannot be used:
36343634 use wcstombs() in this case. */
3635- const wchar_t * filesystem_errors = interp -> config .filesystem_errors ;
3635+ const PyConfig * config = _PyInterpreterState_GetConfig (interp );
3636+ const wchar_t * filesystem_errors = config -> filesystem_errors ;
36363637 assert (filesystem_errors != NULL );
36373638 _Py_error_handler errors = get_error_handler_wide (filesystem_errors );
36383639 assert (errors != _Py_ERROR_UNKNOWN );
@@ -3868,7 +3869,8 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
38683869 /* Before _PyUnicode_InitEncodings() is called, the Python codec
38693870 machinery is not ready and so cannot be used:
38703871 use mbstowcs() in this case. */
3871- const wchar_t * filesystem_errors = interp -> config .filesystem_errors ;
3872+ const PyConfig * config = _PyInterpreterState_GetConfig (interp );
3873+ const wchar_t * filesystem_errors = config -> filesystem_errors ;
38723874 assert (filesystem_errors != NULL );
38733875 _Py_error_handler errors = get_error_handler_wide (filesystem_errors );
38743876 assert (errors != _Py_ERROR_UNKNOWN );
@@ -15894,7 +15896,7 @@ static PyStatus
1589415896init_stdio_encoding (PyThreadState * tstate )
1589515897{
1589615898 /* Update the stdio encoding to the normalized Python codec name. */
15897- PyConfig * config = & tstate -> interp -> config ;
15899+ PyConfig * config = ( PyConfig * ) _PyInterpreterState_GetConfig ( tstate -> interp ) ;
1589815900 if (config_get_codec_name (& config -> stdio_encoding ) < 0 ) {
1589915901 return _PyStatus_ERR ("failed to get the Python codec name "
1590015902 "of the stdio encoding" );
@@ -15906,7 +15908,7 @@ init_stdio_encoding(PyThreadState *tstate)
1590615908static int
1590715909init_fs_codec (PyInterpreterState * interp )
1590815910{
15909- PyConfig * config = & interp -> config ;
15911+ const PyConfig * config = _PyInterpreterState_GetConfig ( interp ) ;
1591015912
1591115913 _Py_error_handler error_handler ;
1591215914 error_handler = get_error_handler_wide (config -> filesystem_errors );
@@ -15964,7 +15966,7 @@ init_fs_encoding(PyThreadState *tstate)
1596415966 /* Update the filesystem encoding to the normalized Python codec name.
1596515967 For example, replace "ANSI_X3.4-1968" (locale encoding) with "ascii"
1596615968 (Python codec name). */
15967- PyConfig * config = & interp -> config ;
15969+ PyConfig * config = ( PyConfig * ) _PyInterpreterState_GetConfig ( interp ) ;
1596815970 if (config_get_codec_name (& config -> filesystem_encoding ) < 0 ) {
1596915971 _Py_DumpPathConfig (tstate );
1597015972 return _PyStatus_ERR ("failed to get the Python codec "
@@ -16008,7 +16010,7 @@ int
1600816010_PyUnicode_EnableLegacyWindowsFSEncoding (void )
1600916011{
1601016012 PyInterpreterState * interp = _PyInterpreterState_GET_UNSAFE ();
16011- PyConfig * config = & interp -> config ;
16013+ PyConfig * config = ( PyConfig * ) _PyInterpreterState_GetConfig ( interp ) ;
1601216014
1601316015 /* Set the filesystem encoding to mbcs/replace (PEP 529) */
1601416016 wchar_t * encoding = _PyMem_RawWcsdup (L"mbcs" );
0 commit comments