diff Modules/python.c @ 74000:3b17210f34d9 3.2

main() now displays an error message before exiting if a command line argument cannot be decoded
author Victor Stinner <victor.stinner@haypocalc.com>
date Fri, 16 Dec 2011 23:48:31 +0100
parents 3c9232a684ae
children c0900fd6e4b3
line wrap: on
line diff
--- a/Modules/python.c	Fri Dec 16 12:28:32 2011 +0100
+++ b/Modules/python.c	Fri Dec 16 23:48:31 2011 +0100
@@ -50,8 +50,12 @@
 #else
         argv_copy[i] = _Py_char2wchar(argv[i], NULL);
 #endif
-        if (!argv_copy[i])
+        if (!argv_copy[i]) {
+            fprintf(stderr, "Fatal Python error: "
+                            "unable to decode the command line argument #%i\n",
+                            i + 1);
             return 1;
+        }
         argv_copy2[i] = argv_copy[i];
     }
     setlocale(LC_ALL, oldloc);