title: Set timeout for FTP connection in Python with ftplib
body: <p>I am triying to set up the timeout of a FTP connection usign:</p>
  <blockquote>
  <p>class ftplib.FTP([host[, user[, passwd[, acct[, timeout]]]]])</p>
  <p>Return a new instance of the FTP class. When host is given, the method call
  connect(host) is made. When user is given, additionally the method
  call login(user, passwd, acct) is made (where passwd and acct default
  to the empty string when not given). The optional timeout parameter
  specifies a timeout in seconds for blocking operations like the
  connection attempt (if is not specified, the global default timeout
  setting will be used).</p>
  </blockquote>
  <p>The problem is that my code to create the connection is as follows:</p>
  <pre><code>from ftplib import FTP
  ftp = FTP('172.16.52.87')
  ftp.login('username', 'password')
  </code></pre>
  <p>I found some problems if I use:</p>
  <pre><code>ftp = FTP('172.16.52.87', 'username', 'password')
  </code></pre>
  <p>Then my question is, how can I set up th timeout ?</p>
  <p>I have tried let some parameters empty but it does not work:</p>
  <pre><code>ftp = FTP('172.16.52.87', '', '', '', '100')
  </code></pre>
  <p>And login function has only 3 parameters <code>login(user, passwd, acct)</code></p>
  <p>Some idea?</p>
  <p>Regards</p>