cpython: 988903cf24c5 (original) (raw)

Mercurial > cpython

changeset 77119:988903cf24c5 2.7

Issue #14036: return None when port in urlparse cross 65535 [#14036]

Senthil Kumaran senthil@uthcode.com
date Thu, 24 May 2012 21:54:34 +0800
parents 290d970c011d
children 5107782c4dd8
files Lib/test/test_urlparse.py Lib/urlparse.py Misc/NEWS
diffstat 3 files changed, 13 insertions(+), 3 deletions(-)[+] [-] Lib/test/test_urlparse.py 5 Lib/urlparse.py 8 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -437,6 +437,11 @@ class UrlParseTestCase(unittest.TestCase self.assertEqual(p.port, 80) self.assertEqual(p.geturl(), url)

+ def test_issue14072(self): p1 = urlparse.urlsplit('tel:+31-641044153') self.assertEqual(p1.scheme, 'tel')

--- a/Lib/urlparse.py +++ b/Lib/urlparse.py @@ -97,9 +97,11 @@ class ResultMixin(object): netloc = self.netloc.split('@')[-1].split(']')[-1] if ':' in netloc: port = netloc.split(':')[1]

from collections import namedtuple

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -64,6 +64,9 @@ Core and Builtins Library ------- +- Issue #14036: Add an additional check to validate that port in urlparse does