209,213d208 < #ifdef Py_USING_UNICODE < /* Init Unicode implementation; relies on the codec registry */ < _PyUnicode_Init(); < #endif < 278,322d272 < #if defined(Py_USING_UNICODE) && defined(HAVE_LANGINFO_H) && defined(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, unless overridden. */ < < if (!overridden || !Py_FileSystemDefaultEncoding) { < saved_locale = strdup(setlocale(LC_CTYPE, NULL)); < setlocale(LC_CTYPE, ""); < loc_codeset = nl_langinfo(CODESET); < if (loc_codeset && *loc_codeset) { < PyObject *enc = PyCodec_Encoder(loc_codeset); < if (enc) { < loc_codeset = strdup(loc_codeset); < Py_DECREF(enc); < } else { < if (PyErr_ExceptionMatches(PyExc_LookupError)) { < PyErr_Clear(); < loc_codeset = NULL; < } else { < PyErr_Print(); < exit(1); < } < } < } else < loc_codeset = NULL; < setlocale(LC_CTYPE, saved_locale); < free(saved_locale); < < if (!overridden) { < codeset = icodeset = loc_codeset; < free_codeset = 1; < } < < /* Initialize Py_FileSystemDefaultEncoding from < locale even if PYTHONIOENCODING is set. */ < if (!Py_FileSystemDefaultEncoding) { < Py_FileSystemDefaultEncoding = loc_codeset; < if (!overridden) < free_codeset = 0; < } < } < #endif < 527,531d476 < < #ifdef Py_USING_UNICODE < /* Cleanup Unicode implementation */ < _PyUnicode_Fini(); < #endif