comparison Python/pythonrun.c @ 53767:ac209f132b17

Issue #5915: Implement PEP 383, Non-decodable Bytes in System Character Interfaces.
author Martin v. Löwis <martin@v.loewis.de>
date Tue, 05 May 2009 04:43:17 +0000
parents 73a7e6aba7b2
children 3416721480b2
comparison
equal deleted inserted replaced
53766:66682fc172e9 53767:ac209f132b17
260 260
261 _PyImport_Init(); 261 _PyImport_Init();
262 262
263 _PyImportHooks_Init(); 263 _PyImportHooks_Init();
264 264
265 #if defined(HAVE_LANGINFO_H) && defined(CODESET)
266 /* On Unix, set the file system encoding according to the
267 user's preference, if the CODESET names a well-known
268 Python codec, and Py_FileSystemDefaultEncoding isn't
269 initialized by other means. Also set the encoding of
270 stdin and stdout if these are terminals. */
271
272 codeset = get_codeset();
273 if (codeset) {
274 if (!Py_FileSystemDefaultEncoding)
275 Py_FileSystemDefaultEncoding = codeset;
276 else
277 free(codeset);
278 }
279 #endif
280
265 if (install_sigs) 281 if (install_sigs)
266 initsigs(); /* Signal handling stuff, including initintr() */ 282 initsigs(); /* Signal handling stuff, including initintr() */
267 283
268 /* Initialize warnings. */ 284 /* Initialize warnings. */
269 _PyWarnings_Init(); 285 _PyWarnings_Init();
283 299
284 /* auto-thread-state API, if available */ 300 /* auto-thread-state API, if available */
285 #ifdef WITH_THREAD 301 #ifdef WITH_THREAD
286 _PyGILState_Init(interp, tstate); 302 _PyGILState_Init(interp, tstate);
287 #endif /* WITH_THREAD */ 303 #endif /* WITH_THREAD */
288
289 #if defined(HAVE_LANGINFO_H) && defined(CODESET)
290 /* On Unix, set the file system encoding according to the
291 user's preference, if the CODESET names a well-known
292 Python codec, and Py_FileSystemDefaultEncoding isn't
293 initialized by other means. Also set the encoding of
294 stdin and stdout if these are terminals. */
295
296 codeset = get_codeset();
297 if (codeset) {
298 if (!Py_FileSystemDefaultEncoding)
299 Py_FileSystemDefaultEncoding = codeset;
300 else
301 free(codeset);
302 }
303 #endif
304 } 304 }
305 305
306 void 306 void
307 Py_Initialize(void) 307 Py_Initialize(void)
308 { 308 {