From 971f3259f126c80b97519c799a923c6d2c33070a Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 9 Oct 2018 18:14:53 +0300 Subject: [PATCH] hdfs: don't use close_fds on Windows Fixes #1197 Signed-off-by: Ruslan Kuprieiev --- dvc/remote/hdfs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dvc/remote/hdfs.py b/dvc/remote/hdfs.py index 306806b8a..ffff79719 100644 --- a/dvc/remote/hdfs.py +++ b/dvc/remote/hdfs.py @@ -29,9 +29,14 @@ class RemoteHDFS(RemoteBase): cmd = 'hadoop fs -' + cmd if user: cmd = 'HADOOP_USER_NAME={} '.format(user) + cmd + + # NOTE: close_fds doesn't work with redirected stdin/stdout/stderr. + # See https://github.com/iterative/dvc/issues/1197. + close_fds = (os.name != 'nt') + p = Popen(cmd, shell=True, - close_fds=True, + close_fds=close_fds, executable=os.getenv('SHELL'), env=fix_env(os.environ), stdin=PIPE,