diff -r 585ad5d806bd Doc/library/ftplib.rst --- a/Doc/library/ftplib.rst Fri Jun 06 17:43:37 2014 -0400 +++ b/Doc/library/ftplib.rst Sat Jun 07 14:11:05 2014 -0700 @@ -41,7 +41,7 @@ The module defines the following items: -.. class:: FTP(host='', user='', passwd='', acct='', timeout=None, source_address=None) +.. class:: FTP(host='', user='', passwd='', acct='', timeout=socket._GLOBAL_DEFAULT_TIMEOUT, source_address=None) Return a new instance of the :class:`FTP` class. When *host* is given, the method call ``connect(host)`` is made. When *user* is given, additionally @@ -74,7 +74,7 @@ *source_address* parameter was added. -.. class:: FTP_TLS(host='', user='', passwd='', acct='', keyfile=None, certfile=None, context=None, timeout=None, source_address=None) +.. class:: FTP_TLS(host='', user='', passwd='', acct='', keyfile=None, certfile=None, context=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, source_address=None) A :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:`4217`. diff -r 585ad5d806bd Lib/ftplib.py --- a/Lib/ftplib.py Fri Jun 06 17:43:37 2014 -0400 +++ b/Lib/ftplib.py Sat Jun 07 14:11:05 2014 -0700 @@ -133,7 +133,7 @@ if self.sock is not None: self.close() - def connect(self, host='', port=0, timeout=-999, source_address=None): + def connect(self, host='', port=0, timeout=None, source_address=None): '''Connect to host. Arguments are: - host: hostname to connect to (string, default previous host) - port: port to connect to (integer, default previous port) @@ -145,7 +145,7 @@ self.host = host if port > 0: self.port = port - if timeout != -999: + if timeout is not None: self.timeout = timeout if source_address is not None: self.source_address = source_address