[Python-checkins] r72231 - python/branches/pep-0383/Python/pythonrun.c
martin.v.loewis
python-checkins at python.org
Sun May 3 10:09:53 CEST 2009
Author: martin.v.loewis
Date: Sun May 3 10:09:51 2009
New Revision: 72231
Log:
Move setting of Py_FileSystemDefaultEncoding before
import of posix.
Modified:
python/branches/pep-0383/Python/pythonrun.c
Modified: python/branches/pep-0383/Python/pythonrun.c
==============================================================================
--- python/branches/pep-0383/Python/pythonrun.c (original)
+++ python/branches/pep-0383/Python/pythonrun.c Sun May 3 10:09:51 2009
@@ -262,6 +262,22 @@
_PyImportHooks_Init();
+#if 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. */
+
+ codeset = get_codeset();
+ if (codeset) {
+ if (!Py_FileSystemDefaultEncoding)
+ Py_FileSystemDefaultEncoding = codeset;
+ else
+ free(codeset);
+ }
+#endif
+
if (install_sigs)
initsigs(); /* Signal handling stuff, including initintr() */
@@ -285,22 +301,6 @@
#ifdef WITH_THREAD
_PyGILState_Init(interp, tstate);
#endif /* WITH_THREAD */
-
-#if 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. */
-
- codeset = get_codeset();
- if (codeset) {
- if (!Py_FileSystemDefaultEncoding)
- Py_FileSystemDefaultEncoding = codeset;
- else
- free(codeset);
- }
-#endif
}
void
More information about the Python-checkins
mailing list