summaryrefslogtreecommitdiffstats
path: root/Modules/python.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-12-16 22:48:31 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-12-16 22:48:31 (GMT)
commit94ba691ed34ffa1aff424876d6162b39a297e29e (patch)
tree3518a6f239306cac5e876012e62e28658a0be30b /Modules/python.c
parentc345ce1a69b3c4a46d87ef56d859bc70abfc74b4 (diff)
downloadcpython-94ba691ed34ffa1aff424876d6162b39a297e29e.zip
cpython-94ba691ed34ffa1aff424876d6162b39a297e29e.tar.gz
cpython-94ba691ed34ffa1aff424876d6162b39a297e29e.tar.bz2
main() now displays an error message before exiting if a command line argument
cannot be decoded
Diffstat (limited to 'Modules/python.c')
-rw-r--r--Modules/python.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/python.c b/Modules/python.c
index 18f9b3d..935908a 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);