@@ -767,7 +767,9 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
767767 'configure_c_stdio' : False ,
768768 'buffered_stdio' : True ,
769769
770- 'stdio_encoding' : GET_DEFAULT_CONFIG ,
770+ 'stdin_encoding' : GET_DEFAULT_CONFIG ,
771+ 'stdout_encoding' : GET_DEFAULT_CONFIG ,
772+ 'stderr_encoding' : GET_DEFAULT_CONFIG ,
771773 'stdio_errors' : GET_DEFAULT_CONFIG ,
772774
773775 'skip_source_first_line' : False ,
@@ -934,16 +936,19 @@ def get_expected_config(self, expected_preconfig, expected,
934936 # there is no easy way to get the locale encoding before
935937 # setlocale(LC_CTYPE, "") is called: don't test encodings
936938 for key in ('filesystem_encoding' , 'filesystem_errors' ,
937- 'stdio_encoding' , 'stdio_errors' ):
939+ 'stdin_encoding' , 'stdout_encoding' ,
940+ 'stderr_encoding' , 'stdio_errors' ):
938941 expected [key ] = self .IGNORE_CONFIG
939942
940943 if expected_preconfig ['utf8_mode' ] == 1 :
941944 if expected ['filesystem_encoding' ] is self .GET_DEFAULT_CONFIG :
942945 expected ['filesystem_encoding' ] = 'utf-8'
943946 if expected ['filesystem_errors' ] is self .GET_DEFAULT_CONFIG :
944947 expected ['filesystem_errors' ] = self .UTF8_MODE_ERRORS
945- if expected ['stdio_encoding' ] is self .GET_DEFAULT_CONFIG :
946- expected ['stdio_encoding' ] = 'utf-8'
948+ for key in ('stdin_encoding' , 'stdout_encoding' ,
949+ 'stderr_encoding' ):
950+ if expected [key ] is self .GET_DEFAULT_CONFIG :
951+ expected [key ] = 'utf-8'
947952 if expected ['stdio_errors' ] is self .GET_DEFAULT_CONFIG :
948953 expected ['stdio_errors' ] = 'surrogateescape'
949954
@@ -1133,7 +1138,9 @@ def test_init_from_config(self):
11331138 'malloc_stats' : True ,
11341139 'pymalloc_hugepages' : True ,
11351140
1136- 'stdio_encoding' : 'iso8859-1' ,
1141+ 'stdin_encoding' : 'iso8859-1' ,
1142+ 'stdout_encoding' : 'iso8859-1' ,
1143+ 'stderr_encoding' : 'iso8859-1' ,
11371144 'stdio_errors' : 'replace' ,
11381145
11391146 'pycache_prefix' : 'conf_pycache_prefix' ,
@@ -1205,7 +1212,9 @@ def test_init_compat_env(self):
12051212 'write_bytecode' : False ,
12061213 'verbose' : 1 ,
12071214 'buffered_stdio' : False ,
1208- 'stdio_encoding' : 'iso8859-1' ,
1215+ 'stdin_encoding' : 'iso8859-1' ,
1216+ 'stdout_encoding' : 'iso8859-1' ,
1217+ 'stderr_encoding' : 'iso8859-1' ,
12091218 'stdio_errors' : 'replace' ,
12101219 'user_site_directory' : False ,
12111220 'faulthandler' : True ,
@@ -1242,7 +1251,9 @@ def test_init_python_env(self):
12421251 'write_bytecode' : False ,
12431252 'verbose' : 1 ,
12441253 'buffered_stdio' : False ,
1245- 'stdio_encoding' : 'iso8859-1' ,
1254+ 'stdin_encoding' : 'iso8859-1' ,
1255+ 'stdout_encoding' : 'iso8859-1' ,
1256+ 'stderr_encoding' : 'iso8859-1' ,
12461257 'stdio_errors' : 'replace' ,
12471258 'user_site_directory' : False ,
12481259 'faulthandler' : True ,
0 commit comments