title: SCP via Python Subprocess Popen: "Identity File not accessible"
body: <p>When executing SCP from subprocess.popen I recieve the error: <code>Warning: Identity File ./id_rsa.key not accessible: no such file or directory.</code>  The problem is explained below.</p>
  
  <p>I want to SCP a file from a local machine to a remote machine, using a python script, and I want to specify the key to use when executing SCP (using -i option).</p>
  
  <p>My local machine is Windows 10 Enterprise.  My 'remote' machine is currently a Docker container running Alpine linux on my localhost.</p>
  
  <p>When I run the command in an elevated shell, it works:</p>
  
  <pre><code>scp -i ./id_rsa.key -P 2222 ./test.plan root@127.0.0.1:/go/
  </code></pre>
  
  <p>When I execute the command via Python 3.6 subprocess.popen: </p>
  
  <pre><code>SSH = subprocess.Popen(['scp', '-i ./id_rsa.key', '-P 2222', './test.plan', 'root@127.0.0.1:/go/'],
      cwd = r'C:\ThePathToThisStuff',
      shell = False,
      stdout=subprocess.PIPE,
      stderr=subprocess.PIPE
  )
  </code></pre>
  
  <p>It prompts me for a password, <code>root@127.0.0.1's password:</code>, and when I enter the password it throws the error below, indicating that it fails to find the RSA key:</p>
  
  <pre><code>&lt;_io.TextIOWrapper name='&lt;stderr&gt;' mode='w' encoding='utf-8'&gt; ERROR: [b'Warning: Identity file  ./id_rsa.key not accessible: No such file or directory.\n']
  </code></pre>
  
  <p>I've tried providing absolute paths to the keys, seperating each command in the arguments list into options and values, different groupings, etc.</p>