-
-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception in child process can lead to duplicate process. #202
Comments
thanks @wracoon, fixed in release-1.10 branch |
This was referenced Oct 6, 2016
This was referenced Nov 27, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
When the child process raises exception in the child block (before executing os.execv), due to too general exception handling it can lead to duplication of process which uses sh.
I encountered the following problem because os.chdir() has raised an exception,
due to path passed to _cwd of command did not exist at the time.
Due to general exception handling in my code the rest of my python program is executed twice by
duplicate process.
Example:
try:
sh.git("clone", origin, local_dir, _cwd="nonexistent_path")
except:
Executed twice.
Fix proposal: The whole child process block should be wrapped in
try:
#child
except:
sys.exit(1)
or something similar.
The text was updated successfully, but these errors were encountered: