summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-08-09 09:47:11 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-08-09 09:47:11 (GMT)
commita2c17c58206cb3fc75bb5331a805663d635c62e2 (patch)
tree87ba4e19026a8f385336068b301d27f0b3afb479 /Python/sysmodule.c
parentfc9b75fafb8b1fefc75b47f1f3135536167dfc07 (diff)
downloadcpython-a2c17c58206cb3fc75bb5331a805663d635c62e2.zip
cpython-a2c17c58206cb3fc75bb5331a805663d635c62e2.tar.gz
cpython-a2c17c58206cb3fc75bb5331a805663d635c62e2.tar.bz2
Move initialization of sys.std{in,out}.encoding to Py_Initialize.
Verify that the encoding actually exists. Fixes #775985. Will backport to 2.3.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 8c77a88..c98e9f1 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -905,9 +905,6 @@ _PySys_Init(void)
#ifdef MS_WINDOWS
char buf[10];
#endif
-#if defined(HAVE_LANGINFO_H) && defined(CODESET)
- char *oldloc, *codeset;
-#endif
m = Py_InitModule3("sys", sys_methods, sys_doc);
sysdict = PyModule_GetDict(m);
@@ -930,21 +927,6 @@ _PySys_Init(void)
}
#endif
-#if defined(HAVE_LANGINFO_H) && defined(CODESET)
- oldloc = setlocale(LC_CTYPE, 0);
- setlocale(LC_CTYPE, "");
- codeset = nl_langinfo(CODESET);
- setlocale(LC_CTYPE, oldloc);
- if(codeset && isatty(fileno(stdin))){
- if (!PyFile_SetEncoding(sysin, codeset))
- return NULL;
- }
- if(codeset && isatty(fileno(stdout))) {
- if (!PyFile_SetEncoding(sysout, codeset))
- return NULL;
- }
-#endif
-
PyDict_SetItemString(sysdict, "stdin", sysin);
PyDict_SetItemString(sysdict, "stdout", sysout);
PyDict_SetItemString(sysdict, "stderr", syserr);