title: Unix Popen.communicate not able to gzip large file
body: <p>I need to gzip files of size more than 10 GB using python on top of shell commands and hence decided to use subprocess Popen.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>outputdir = '/mnt/json/output/'
  inp_cmd='gzip -r ' + outputdir
  
  pipe = Popen(["bash"], stdout =PIPE,stdin=PIPE,stderr=PIPE)
  cmd = bytes(inp_cmd.encode('utf8'))
  stdout_data,stderr_data = pipe.communicate(input=cmd)
  </code></pre>
  
  <p>It is not gzip-ing the files within output directory.
  Any way out?</p>