File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed
Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -730,21 +730,14 @@ initfsencoding(void)
730730 /* On Unix, set the file system encoding according to the
731731 user's preference, if the CODESET names a well-known
732732 Python codec, and Py_FileSystemDefaultEncoding isn't
733- initialized by other means. Also set the encoding of
734- stdin and stdout if these are terminals. */
733+ initialized by other means. */
735734 codeset = get_codeset ();
736- if (codeset != NULL ) {
737- Py_FileSystemDefaultEncoding = codeset ;
738- Py_HasFileSystemDefaultEncoding = 0 ;
739- return ;
740- } else {
741- fprintf (stderr , "Unable to get the locale encoding:\n" );
742- PyErr_Print ();
743- }
735+ if (codeset == NULL )
736+ Py_FatalError ("Py_Initialize: Unable to get the locale encoding" );
744737
745- fprintf ( stderr , "Unable to get the filesystem encoding: fallback to utf-8\n" ) ;
746- Py_FileSystemDefaultEncoding = "utf-8" ;
747- Py_HasFileSystemDefaultEncoding = 1 ;
738+ Py_FileSystemDefaultEncoding = codeset ;
739+ Py_HasFileSystemDefaultEncoding = 0 ;
740+ return ;
748741 }
749742#endif
750743
You can’t perform that action at this time.
0 commit comments