Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0f29c2

Browse files
committed
When a port is specified in an ftp:// URL, must convert it to a number!
1 parent 240ddc8 commit c0f29c2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/urllib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ def open_ftp(self, url):
323323
if not port:
324324
import ftplib
325325
port = ftplib.FTP_PORT
326+
else:
327+
port = int(port)
326328
path, attrs = splitattr(path)
327329
dirs = string.splitfields(path, '/')
328330
dirs, file = dirs[:-1], dirs[-1]

0 commit comments

Comments
 (0)