From a27115bff1d1cbf09dffb5031e6f753e1219f0c9 Mon Sep 17 00:00:00 2001 From: Pablo Santiago Blum de Aguiar Date: Mon, 21 Mar 2016 16:58:31 -0300 Subject: [PATCH] #484: Use PIPE as stdin when Popening the script Fix #484 --- tests/test_types.py | 1 + thefuck/types.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_types.py b/tests/test_types.py index 3ff3fccb..dcb4e874 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -110,6 +110,7 @@ class TestCommand(object): 'apt-get search vim', 'stdout', 'stderr') Popen.assert_called_once_with('apt-get search vim', shell=True, + stdin=PIPE, stdout=PIPE, stderr=PIPE, env={}) diff --git a/thefuck/types.py b/thefuck/types.py index 81a7d1bb..62857609 100644 --- a/thefuck/types.py +++ b/thefuck/types.py @@ -114,7 +114,7 @@ class Command(object): env.update(settings.env) with logs.debug_time(u'Call: {}; with env: {};'.format(script, env)): - result = Popen(script, shell=True, stdout=PIPE, stderr=PIPE, env=env) + result = Popen(script, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env) if cls._wait_output(result): stdout = result.stdout.read().decode('utf-8') stderr = result.stderr.read().decode('utf-8')