mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
* when given, port should be converted to int
* when connecting, if the port is non-standard, display it as well
This commit is contained in:
parent
7dfb02d09a
commit
a5f8c42268
1 changed files with 3 additions and 1 deletions
|
|
@ -55,6 +55,7 @@ def main():
|
||||||
port = 0
|
port = 0
|
||||||
if ':' in host:
|
if ':' in host:
|
||||||
host, port = host.split(':', 1)
|
host, port = host.split(':', 1)
|
||||||
|
port = int(port)
|
||||||
try:
|
try:
|
||||||
auth = netrc.netrc().authenticators(host)
|
auth = netrc.netrc().authenticators(host)
|
||||||
if auth is not None:
|
if auth is not None:
|
||||||
|
|
@ -81,7 +82,8 @@ def main():
|
||||||
if args[3:]: usage('too many arguments')
|
if args[3:]: usage('too many arguments')
|
||||||
#
|
#
|
||||||
f = ftplib.FTP()
|
f = ftplib.FTP()
|
||||||
if verbose: print 'Connecting to %s...' % `host`
|
if verbose: print "Connecting to '%s%s'..." % (host,
|
||||||
|
(port and ":%d"%port or ""))
|
||||||
f.connect(host,port)
|
f.connect(host,port)
|
||||||
if not nologin:
|
if not nologin:
|
||||||
if verbose:
|
if verbose:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue