Skip to content

Commit

Permalink
Add #ifdef MS_WINDOWS
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Aug 16, 2023
1 parent 592f255 commit 3a3983f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,8 @@ Removed
* ``Py_SetProgramName()``: set :c:member:`PyConfig.program_name` instead.
* ``Py_SetPythonHome()``: set :c:member:`PyConfig.home` instead.
* ``Py_SetStandardStreamEncoding()``: set :c:member:`PyConfig.stdio_encoding`
instead, and set also maybe :c:member:`PyConfig.legacy_windows_stdio`.
instead, and set also maybe :c:member:`PyConfig.legacy_windows_stdio` (on
Windows).
* ``_Py_SetProgramFullPath()``: set :c:member:`PyConfig.executable` instead.

Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization
Expand Down
2 changes: 2 additions & 0 deletions Programs/_testembed.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,11 @@ static void check_stdio_details(const wchar_t *encoding, const wchar_t *errors)
if (errors) {
config_set_string(&config, &config.stdio_errors, errors);
}
#ifdef MS_WINDOWS
// gh-106659: On Windows, don't use _io._WindowsConsoleIO which always
// announce UTF-8 for sys.stdin.encoding.
config.legacy_windows_stdio = 1;
#endif
config_set_program_name(&config);
init_from_config_clear(&config);

Expand Down

0 comments on commit 3a3983f

Please sign in to comment.