]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
main() now displays an error message before exiting if a command line argument
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 16 Dec 2011 22:48:31 +0000 (23:48 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 16 Dec 2011 22:48:31 +0000 (23:48 +0100)
cannot be decoded

Modules/python.c

index 18f9b3dd668239c585484f8658b77d707939078a..935908af5dc2955a14815b8ec0f5a443232e8c2f 100644 (file)
@@ -50,8 +50,12 @@ main(int argc, char **argv)
 #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);