From 8f6b6b0cc3febd15e33a96bd31dcb3cbef2ad1ac Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 13 Oct 2010 22:02:27 +0000 Subject: Issue #9992: Remove PYTHONFSENCODING environment variable. --- Python/pythonrun.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index a888a19f20..012c1b85f2 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -980,22 +980,12 @@ initfsencoding(void) 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"); -- cgit v1.2.1