From: Victor Stinner Date: Fri, 16 Dec 2011 22:48:31 +0000 (+0100) Subject: main() now displays an error message before exiting if a command line argument X-Git-Tag: v3.2.3rc1~280 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=94ba691ed34ffa1aff424876d6162b39a297e29e;p=thirdparty%2FPython%2Fcpython.git main() now displays an error message before exiting if a command line argument cannot be decoded --- diff --git a/Modules/python.c b/Modules/python.c index 18f9b3dd6682..935908af5dc2 100644 --- a/Modules/python.c +++ b/Modules/python.c @@ -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);