[Python-checkins] r85886 - python/branches/issue10209/Python/pythonrun.c

victor.stinner python-checkins at python.org
Thu Oct 28 14:13:54 CEST 2010


Author: victor.stinner
Date: Thu Oct 28 14:13:54 2010
New Revision: 85886

Log:
Call _PyUnicode_InitFSEncoding() after initstdio()

The warning message is written to stderr, it's better than initialize stderr
first. Clear also the error.


Modified:
   python/branches/issue10209/Python/pythonrun.c

Modified: python/branches/issue10209/Python/pythonrun.c
==============================================================================
--- python/branches/issue10209/Python/pythonrun.c	(original)
+++ python/branches/issue10209/Python/pythonrun.c	Thu Oct 28 14:13:54 2010
@@ -315,6 +315,14 @@
         Py_FatalError(
             "Py_Initialize: can't initialize sys standard streams");
 
+#ifdef __APPLE__
+    if (_PyUnicode_InitFSEncoding()) {
+        PyErr_Clear();
+        PyErr_Warn(PyExc_RuntimeWarning,
+            "Unable to get normalize() function of the unicodedata module");
+    }
+#endif
+
     if (!Py_NoSiteFlag)
         initsite(); /* Module site */
 }
@@ -755,13 +763,6 @@
     } else {
         Py_DECREF(codec);
     }
-
-#ifdef __APPLE__
-    if (_PyUnicode_InitFSEncoding()) {
-        PyErr_Warn(PyExc_RuntimeWarning,
-            "Unable to get normalize() function of the unicodedata module");
-    }
-#endif
 }
 
 /* Import the site module (not into __main__ though) */


More information about the Python-checkins mailing list