commit | 2fc5a5080923f243a78b13cca0fd09f8db26eff6 | [log] [tgz] |
---|---|---|
author | Senthil Kumaran <senthil@uthcode.com> | Thu May 24 21:56:17 2012 +0800 |
committer | Senthil Kumaran <senthil@uthcode.com> | Thu May 24 21:56:17 2012 +0800 |
tree | 19f2eff518b2d2018aa0add9292cc39e2a5d60cc | |
parent | 346c5de08e92001f0b26b4d07d8f2a22a21d2f1e [diff] |
Issue #14036: return None when port in urlparse cross 65535
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 92170ad..528c0a7 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py
@@ -143,6 +143,9 @@ port = self._hostinfo[1] if port is not None: port = int(port, 10) + # Return None on an illegal port + if not ( 0 <= port <= 65535): + return None return port