diff Python/pythonrun.c @ 65265:a75fd31ddabb

Issue #9992: Remove PYTHONFSENCODING environment variable.
author Victor Stinner <victor.stinner@haypocalc.com>
date Wed, 13 Oct 2010 22:02:27 +0000
parents 01b96f78fb70
children f63d747622bd
line wrap: on
line diff
--- a/Python/pythonrun.c	Wed Oct 13 21:59:36 2010 +0000
+++ b/Python/pythonrun.c	Wed Oct 13 22:02:27 2010 +0000
@@ -980,22 +980,12 @@
     char *codeset = NULL;
 
     if (Py_FileSystemDefaultEncoding == NULL) {
-        const char *env_encoding = Py_GETENV("PYTHONFSENCODING");
-        if (env_encoding != NULL) {
-            codeset = get_codec_name(env_encoding);
-            if (!codeset) {
-                fprintf(stderr, "PYTHONFSENCODING is not a valid encoding:\n");
-                PyErr_Print();
-            }
-        }
-        if (!codeset) {
-            /* On Unix, set the file system encoding according to the
-               user's preference, if the CODESET names a well-known
-               Python codec, and Py_FileSystemDefaultEncoding isn't
-               initialized by other means. Also set the encoding of
-               stdin and stdout if these are terminals.  */
-            codeset = get_codeset();
-        }
+        /* On Unix, set the file system encoding according to the
+           user's preference, if the CODESET names a well-known
+           Python codec, and Py_FileSystemDefaultEncoding isn't
+           initialized by other means. Also set the encoding of
+           stdin and stdout if these are terminals.  */
+        codeset = get_codeset();
         if (codeset != NULL) {
             if (redecode_filenames(codeset))
                 Py_FatalError("Py_Initialize: can't redecode filenames");