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

Skip to content

Commit 1204141

Browse files
committed
Fixes #1350
1 parent fef8f20 commit 1204141

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3470,8 +3470,13 @@ def quote(s, safe):
34703470
netloc = ':' + password + netloc
34713471
netloc = username + netloc
34723472

3473-
if parts.port:
3474-
netloc += ':' + str(parts.port)
3473+
try:
3474+
port = parts.port
3475+
except:
3476+
port = None
3477+
3478+
if port:
3479+
netloc += ':' + str(port)
34753480

34763481
return urlparse.urlunsplit([parts.scheme, netloc, path, query, parts.fragment])
34773482

0 commit comments

Comments
 (0)