summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-13 22:02:27 +0000
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-13 22:02:27 +0000
commite27a5e8d1136800ee4395e2172fc51c1dd44d271 (patch)
tree6c3be1bbd8dc224b8292b60c7bdffb300677932e /Python/pythonrun.c
parent9ac2c02ee4f38f0f68a5e8cf271784de3e82d6e5 (diff)
downloadcpython-e27a5e8d1136800ee4395e2172fc51c1dd44d271.tar.gz
Issue #9992: Remove PYTHONFSENCODING environment variable.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c22
1 files changed, 6 insertions, 16 deletions
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");