Index: Lib/ftplib.py =================================================================== --- Lib/ftplib.py (revision 66513) +++ Lib/ftplib.py (working copy) @@ -253,7 +253,7 @@ port number. ''' hbytes = host.split('.') - pbytes = [repr(port/256), repr(port%256)] + pbytes = [repr(int(port/256)), repr(int(port%256))] bytes = hbytes + pbytes cmd = 'PORT ' + ','.join(bytes) return self.voidcmd(cmd)