mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
(Merge 3.2) main() now displays an error message before exiting if a command
line argument cannot be decoded
This commit is contained in:
commit
3607e3de27
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue