From b445b97a7f393b51e0ddfd28d1185ee85625d932 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 10 Jul 2020 16:51:30 -0400 Subject: [PATCH] Fix FFMpegBase.isAvailable with detached terminals. When checking for ffmpeg/libav, set stdin to /dev/null, otherwise the process will sleep if Python is running with a detached terminal. And we definitely don't want ffmpeg/libav to grab user input here. --- lib/matplotlib/animation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/animation.py b/lib/matplotlib/animation.py index 6ef1a04d7f35..a30675fd1271 100644 --- a/lib/matplotlib/animation.py +++ b/lib/matplotlib/animation.py @@ -597,7 +597,8 @@ def isAvailable(cls): # NOTE: when removed, remove the same method in AVConvBase. and b'LibAv' not in subprocess.run( [cls.bin_path()], creationflags=subprocess_creation_flags, - stdout=subprocess.DEVNULL, stderr=subprocess.PIPE).stderr) + stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, + stderr=subprocess.PIPE).stderr) # Combine FFMpeg options with pipe-based writing