diff Python/bltinmodule.c @ 71191:7ce685cda0ae

Issue #9642: Fix filesystem encoding initialization: use the ANSI code page on Windows if the mbcs codec is not available, and fail with a fatal error if we cannot get the locale encoding (if nl_langinfo(CODESET) is not available) instead of using UTF-8.
author Victor Stinner <victor.stinner@haypocalc.com>
date Mon, 04 Jul 2011 13:48:30 +0200
parents 11052e067192
children 13e6d3cb2ecd
line wrap: on
line diff
--- a/Python/bltinmodule.c	Mon Jul 04 11:51:21 2011 +0200
+++ b/Python/bltinmodule.c	Mon Jul 04 13:48:30 2011 +0200
@@ -24,12 +24,9 @@
 #elif defined(__APPLE__)
 const char *Py_FileSystemDefaultEncoding = "utf-8";
 int Py_HasFileSystemDefaultEncoding = 1;
-#elif defined(HAVE_LANGINFO_H) && defined(CODESET)
+#else
 const char *Py_FileSystemDefaultEncoding = NULL; /* set by initfsencoding() */
 int Py_HasFileSystemDefaultEncoding = 0;
-#else
-const char *Py_FileSystemDefaultEncoding = "utf-8";
-int Py_HasFileSystemDefaultEncoding = 1;
 #endif
 
 static PyObject *