Message338297
If we set argv0 to ".":
if (_Py_wgetcwd(fullpath, Py_ARRAY_LENGTH(fullpath))) {
argv0 = fullpath;
n = wcslen(argv0);
}
else {
argv0 = L".";
n = 1;
}
then the caller does not have any way of knowing if the returned argv0 is due
to the fact that _Py_wgetcwd failed so it will blindly add "." to sys.path unless
we set the result using PyObject** and then returning some error code to signal
what happened (or something similar). On the other hand, I do not like this API,
because returning some error code != 0 from _PyPathConfig_ComputeArgv0 would be
weird because the call actually succeeded (it has returned "." as the value for argv0).
What do you think is the best way to signal pymain_run_python that the current directory
does not exist (because _Py_wgetcwd has failed)? |
|
Date |
User |
Action |
Args |
2019-03-18 23:10:07 | pablogsal | set | recipients:
+ pablogsal, ronaldoussoren, ncoghlan, vstinner, ned.deily, lkollar |
2019-03-18 23:10:07 | pablogsal | set | messageid: <1552950607.1.0.273595331722.issue36236@roundup.psfhosted.org> |
2019-03-18 23:10:07 | pablogsal | link | issue36236 messages |
2019-03-18 23:10:07 | pablogsal | create | |
|