diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2012-05-24 13:57:38 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2012-05-24 13:57:38 (GMT) |
commit | 4715ca560004b6df0d573084a07a9355b7ac189f (patch) | |
tree | d25915a6c31d286be00f876248c1e5d3a6fe7acd /Lib/test | |
parent | b95c63413d3ac5963187b6d528b1147229a1f190 (diff) | |
parent | 2fc5a5080923f243a78b13cca0fd09f8db26eff6 (diff) | |
download | cpython-4715ca560004b6df0d573084a07a9355b7ac189f.zip cpython-4715ca560004b6df0d573084a07a9355b7ac189f.tar.gz cpython-4715ca560004b6df0d573084a07a9355b7ac189f.tar.bz2 |
Issue #14036: return None when port in urlparse cross 65535
Diffstat (limited to 'Lib/test')
-rwxr-xr-x | Lib/test/test_urlparse.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index 73150cf..e9adaef 100755 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -524,6 +524,11 @@ class UrlParseTestCase(unittest.TestCase): self.assertEqual(p.port, 80) self.assertEqual(p.geturl(), url) + # Verify an illegal port is returned as None + url = b"HTTP://WWW.PYTHON.ORG:65536/doc/#frag" + p = urllib.parse.urlsplit(url) + self.assertEqual(p.port, None) + def test_attributes_bad_port(self): """Check handling of non-integer ports.""" p = urllib.parse.urlsplit("http://www.example.net:foo") |