Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 94ba691

Browse files
author
Victor Stinner
committed
main() now displays an error message before exiting if a command line argument
cannot be decoded
1 parent c345ce1 commit 94ba691

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Modules/python.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ main(int argc, char **argv)
5050
#else
5151
argv_copy[i] = _Py_char2wchar(argv[i], NULL);
5252
#endif
53-
if (!argv_copy[i])
53+
if (!argv_copy[i]) {
54+
fprintf(stderr, "Fatal Python error: "
55+
"unable to decode the command line argument #%i\n",
56+
i + 1);
5457
return 1;
58+
}
5559
argv_copy2[i] = argv_copy[i];
5660
}
5761
setlocale(LC_ALL, oldloc);

0 commit comments

Comments
 (0)