title: Getting an Unexpected remote arg error when trying to run rsync in python subprocess
body: <p>I am trying to make an Rsync call in python 3.4 using the <code>call()</code> method of the subprocess module and public keys for authentication, so that I can sync a remote folder.  The location of the folder is passed in dynamically via JSON.  The code involved is as follows:</p>
  
  <pre><code>response_dict = json.loads(response)
  source = 'user@server.example.com:' + response_dict['path'] + '/'
  args = ['rsync', '-rv', '-e', '--delete', '--progress', '--update', 'ssh', '-i', '/path/to/public.key', source, '/path/to/local/folder/']
  call(args)
  </code></pre>
  
  <p>I've tried several variations of the command, including:</p>
  
  <pre><code>args = ['rsync', '-rv', '-e', 'ssh', '-i', '/path/to/public.key', source, '/path/to/local/folder/', '--delete', '--progress', '--update']
  </code></pre>
  
  <p>and</p>
  
  <pre><code>args = ['rsync', '-rv', '-e', 'ssh', '-i', '/path/to/public.key', '-l', 'user', source, '/path/to/local/folder/', '--delete', '--progress', '--update']
  </code></pre>
  
  <p>and even</p>
  
  <pre><code>args = ['rsync', '-rv', '-e', 'ssh', '-i', '/path/to/public.key', '-l', 'user', 'user@server.example.com:' + response_dict['path'] + '/', '/path/to/local/folder/', '--delete', '--progress', '--update']
  </code></pre>
  
  <p>But I get the same error: </p>
  
  <pre><code>Unexpected remote arg: user@server.example.com:/path/to/remote/folder/ 
  rsync error: syntax or usage error (code 1) at main.c(1330) [sender=3.1.1]
  </code></pre>
  
  <p>I'm new to python and am pretty much learning as I go along, but this one has me completely stumped.  I've been googling for the whole day and most of yesterday, but every solution to a similar problem I've found has had no effect.  If someone could help me figure out what's going wrong, it'd be much appreciated.</p>