Merge pull request #2524 from beetbox/command-output-close-stdin

Close stdin when performing `command_output()`
This commit is contained in:
Nathan Dwek 2017-04-24 20:31:04 +02:00 committed by GitHub
commit 68089ac8e9
2 changed files with 11 additions and 0 deletions

View file

@ -797,10 +797,16 @@ def command_output(cmd, shell=False):
"""
cmd = convert_command_args(cmd)
try: # python >= 3.3
devnull = subprocess.DEVNULL
except AttributeError:
devnull = open(os.devnull, 'r+b')
proc = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=devnull,
close_fds=platform.system() != 'Windows',
shell=shell
)

View file

@ -52,6 +52,11 @@ New features:
* :doc:`/plugins/play`: A new ``-y`` or ``--yes`` parameter lets you skip
the warning message if you enqueue more items than the warning threshold
usually allows.
* Fix a bug where commands which forked subprocesses would sometimes prevent
further inputs. This bug mainly affected :doc:`/plugins/convert`.
Thanks to :user:`jansol`.
:bug:`2488`
:bug:`2524`
Fixes: