diff Python/pythonrun.c @ 72976:af0800b986b7

Issue #12281: Rewrite the MBCS codec to handle correctly replace and ignore error handlers on all Windows versions. The MBCS codec is now supporting all error handlers, instead of only replace to encode and ignore to decode.
author Victor Stinner <victor.stinner@haypocalc.com>
date Tue, 18 Oct 2011 21:21:00 +0200
parents db4aa878cea2
children fa2f8dd077e0
line wrap: on
line diff
--- a/Python/pythonrun.c	Tue Oct 18 17:52:24 2011 +0200
+++ b/Python/pythonrun.c	Tue Oct 18 21:21:00 2011 +0200
@@ -67,7 +67,7 @@
 static void call_py_exitfuncs(void);
 static void wait_for_thread_shutdown(void);
 static void call_ll_exitfuncs(void);
-extern void _PyUnicode_Init(void);
+extern int _PyUnicode_Init(void);
 extern void _PyUnicode_Fini(void);
 extern int _PyLong_Init(void);
 extern void PyLong_Fini(void);
@@ -261,7 +261,8 @@
         Py_FatalError("Py_Initialize: can't make modules_reloading dictionary");
 
     /* Init Unicode implementation; relies on the codec registry */
-    _PyUnicode_Init();
+    if (_PyUnicode_Init() < 0)
+        Py_FatalError("Py_Initialize: can't initialize unicode");
 
     bimod = _PyBuiltin_Init();
     if (bimod == NULL)