summaryrefslogtreecommitdiffstats
path: root/Programs
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-16 11:56:56 (GMT)
committerGitHub <noreply@github.com>2023-08-16 11:56:56 (GMT)
commite35c722d22cae605b485e75a69238dc44aab4c96 (patch)
tree3af27804a91265d2b76ff1ba3d24c19fe5247d5c /Programs
parent57a20b0960f5c087a476b34c72f608580746cab5 (diff)
downloadcpython-e35c722d22cae605b485e75a69238dc44aab4c96.zip
cpython-e35c722d22cae605b485e75a69238dc44aab4c96.tar.gz
cpython-e35c722d22cae605b485e75a69238dc44aab4c96.tar.bz2
gh-106659: Fix test_embed.test_forced_io_encoding() on Windows (#108010)
Use config.legacy_windows_stdio=1 to avoid _io._WindowsConsoleIO.
Diffstat (limited to 'Programs')
-rw-r--r--Programs/_testembed.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index 351cdc3..7ee64b2 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -237,6 +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);