Merge branch 'johnhawkinson-stdin2'
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 22 Oct 2016 05:10:27 +0000 (13:10 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 22 Oct 2016 05:10:27 +0000 (13:10 +0800)
ChangeLog
youtube_dl/utils.py

index 4987fb7ca674d65eae03126f21b9888ab5662c31..825e357a4a71b80fec73b732017e96061bdc7161 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+version <unreleased>
+
+Core
+* Running youtube-dl in the background is fixed (#10996, #10706, #955)
+
+
 version 2016.10.21.1
 
 Extractors
index 28941673fa9bec36b24464faa79cc3b2348aca99..2770c5f1c5ee55ea4708ce8cbfc3a0e249a2b23d 100644 (file)
@@ -1818,8 +1818,12 @@ def get_exe_version(exe, args=['--version'],
     """ Returns the version of the specified executable,
     or False if the executable is not present """
     try:
+        # STDIN should be redirected too. On UNIX-like systems, ffmpeg triggers
+        # SIGTTOU if youtube-dl is run in the background.
+        # See https://github.com/rg3/youtube-dl/issues/955#issuecomment-209789656
         out, _ = subprocess.Popen(
             [encodeArgument(exe)] + args,
+            stdin=subprocess.PIPE,
             stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()
     except OSError:
         return False