title: ftps.storlines socket.timeout despite file upload completing
body: <p>I'm trying to upload a CSV file using ftplib.FTP_TLS, however regardless of the timeout duration I set (5,10,60 seconds), the code always times out with the error:</p>
  
  <pre><code>File "/usr/lib/python3.4/ftplib.py", line 544, in storlines
    conn.unwrap()
  File "/usr/lib/python3.4/ssl.py", line 788, in unwrap
    s = self._sslobj.shutdown()
  socket.timeout: The read operation timed out
  </code></pre>
  
  <p>However after the timeout, I check the directory through Cyberduck, and the CSV file is there, complete.</p>
  
  <p>Here is my upload code:</p>
  
  <pre><code>def upload_csv(filename):
      with FTP_TLS(timeout=5) as ftps:
          ftps.set_pasv(True)
          ftps.connect(ftps_server,ftps_port)
          ftps.login(ftps_username, ftps_password)
          ftps.prot_p()
          ftps.cwd('sales')
          ftps.storlines("STOR " + filename, open(filename,'rb'))
  </code></pre>
  
  <p>I've also tried storbinary(...) but get the same error.</p>
  
  <p>Edit:
  The file definitely exists, and does actually get created on the server in its entirety.  It looks like it's a problem with .shutdown() in ssl.py maybe waiting for a final read, but the internet doesn't seem to yield a solution.</p>
  
  <p>Can anyone shed any light please?</p>