Change call function to Popen

The call function can deadlock if the child process prints larger output. Use Popen with the communicate() method with you need pipes. If you switch to Popen, you'll get cleaner debugging.
This commit is contained in:
John Jackson 2021-06-07 13:52:20 -06:00 committed by GitHub
parent 54774ab91e
commit 62baabc31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,8 +87,8 @@ class ReplicationError(Exception):
def cmd_exists(cmd): def cmd_exists(cmd):
return subprocess.call("type " + cmd, shell=True, proc subprocess.Popen("type " + cmd, shell=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def replicate_url(full_url, def replicate_url(full_url,