title: python, aws S3 download zip file
body: <p>I am trying to download a .zip file from AWS S3 using boto code, however getting following error:</p>
  
  <p>'str' object has no attribute 'write'</p>
  
  <p><strong>code</strong> </p>
  
  <pre><code>s3Conn = S3Connection(aws_access_key_id='ABCD',
                        aws_secret_access_key='xyz')
  s3bucket = s3Conn.get_bucket(mybucket)
  
  key = s3bucket.new_key("2015/02/20/TestFile.zip")  
  try:
      key.get_contents_to_file(backupdir)
  except:
      print("{0}".format(sys.exc_info()))
  </code></pre>