diff Lib/test/test_urlparse.py @ 77120:d769e64aed79 3.2

Issue #14036: return None when port in urlparse cross 65535
author Senthil Kumaran <senthil@uthcode.com>
date Thu, 24 May 2012 21:56:17 +0800
parents 9f6b7576c08c
children d002a2e46383
line wrap: on
line diff
--- a/Lib/test/test_urlparse.py	Wed May 23 17:42:50 2012 +0200
+++ b/Lib/test/test_urlparse.py	Thu May 24 21:56:17 2012 +0800
@@ -524,6 +524,11 @@
         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")