Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not use setsid directly, use dedicated start_new_session
Just ran into https://stackoverflow.com/questions/42257512/difference-between-subprocess-popen-preexec-fn-and-start-new-session-in-python which points to python docs at https://docs.python.org/3.4/library/subprocess.html?highlight=subprocess#popen-constructor Warning The preexec_fn parameter is not safe to use in the presence of threads in your application. The child process could deadlock before exec is called. If you must use it, keep it trivial! Minimize the number of libraries you call into. Note If you need to modify the environment for the child use the env parameter rather than doing it in a preexec_fn. The start_new_session parameter can take the place of a previously common use of preexec_fn to call os.setsid() in the child. So smells like we better use this dedicated option added in 3.2 .
- Loading branch information