Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 37423:57b1ff138995 legacy-trunk
Bug #1421664: Set sys.stderr.encoding
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Mon, 03 Apr 2006 10:56:49 +0000 |
| parents | 91a9e2e31e93 |
| children | 65ecb83ea7dd |
comparison
equal
deleted
inserted
replaced
| 37422:e956e16e7444 | 37423:57b1ff138995 |
|---|---|
| 1065 return NULL; | 1065 return NULL; |
| 1066 } | 1066 } |
| 1067 if(isatty(_fileno(stdout))) { | 1067 if(isatty(_fileno(stdout))) { |
| 1068 sprintf(buf, "cp%d", GetConsoleOutputCP()); | 1068 sprintf(buf, "cp%d", GetConsoleOutputCP()); |
| 1069 if (!PyFile_SetEncoding(sysout, buf)) | 1069 if (!PyFile_SetEncoding(sysout, buf)) |
| 1070 return NULL; | |
| 1071 } | |
| 1072 if(isatty(_fileno(stderr))) { | |
| 1073 sprintf(buf, "cp%d", GetConsoleOutputCP()); | |
| 1074 if (!PyFile_SetEncoding(syserr, buf)) | |
| 1070 return NULL; | 1075 return NULL; |
| 1071 } | 1076 } |
| 1072 #endif | 1077 #endif |
| 1073 | 1078 |
| 1074 PyDict_SetItemString(sysdict, "stdin", sysin); | 1079 PyDict_SetItemString(sysdict, "stdin", sysin); |
