Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
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
7 changes: 6 additions & 1 deletion 7 Modules/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,7 @@ pymain_read_conf_impl(_PyMain *pymain, _Py_CommandLineDetails *cmdline)
static int
pymain_read_conf(_PyMain *pymain, _Py_CommandLineDetails *cmdline)
{
int init_utf8_mode = Py_UTF8Mode;
_PyCoreConfig *config = &pymain->config;
_PyCoreConfig save_config = _PyCoreConfig_INIT;
int res = -1;
Expand Down Expand Up @@ -2016,6 +2017,10 @@ pymain_read_conf(_PyMain *pymain, _Py_CommandLineDetails *cmdline)
goto done;
}

/* bpo-34207: Py_DecodeLocale(), Py_EncodeLocale() and similar
functions depend on Py_UTF8Mode. */
Py_UTF8Mode = config->utf8_mode;

if (pymain_init_cmdline_argv(pymain, cmdline) < 0) {
goto done;
}
Expand Down Expand Up @@ -2086,7 +2091,7 @@ pymain_read_conf(_PyMain *pymain, _Py_CommandLineDetails *cmdline)
setlocale(LC_ALL, oldloc);
PyMem_RawFree(oldloc);
}

Py_UTF8Mode = init_utf8_mode ;
return res;
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.