Damon Atkins added the comment:
I see from this. That this is still an issue
Is it not a solution to
save current directory location
chdir(cwd) before calling _winapi.CreateProcess()
restore the original directory.
This will result in the cwd being searched for the executable, which most people would expect to happen. It seems CreateProcess does not change to cwd until after the file is checked for existence or loaded.
nosy: +Damon Atkins