cpython: 901e4e52b20a (original) (raw)

Mercurial > cpython

changeset 92517:901e4e52b20a

Issue #22278: Fix urljoin problem with relative urls, a regression observed after changes to issue22118 were submitted. Patch contributed by Demian Brecht and reviewed by Antoine Pitrou. [#22278]

Senthil Kumaran senthil@uthcode.com
date Mon, 22 Sep 2014 15:49:16 +0800
parents 850a62354402
children 00a11276ae6d
files Lib/test/test_urlparse.py Lib/urllib/parse.py Misc/NEWS
diffstat 3 files changed, 20 insertions(+), 1 deletions(-)[+] [-] Lib/test/test_urlparse.py 12 Lib/urllib/parse.py 6 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -380,6 +380,18 @@ class UrlParseTestCase(unittest.TestCase # self.checkJoin(SIMPLE_BASE, '../../../g','http://a/../g')[](#l1.4) # self.checkJoin(SIMPLE_BASE, '/./g','http://a/./g')[](#l1.5)

+

+ def test_RFC2732(self): str_cases = [ ('http://Test.python.org:5432/foo/', 'test.python.org', 5432),

--- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -443,6 +443,10 @@ def urljoin(base, url, allow_fragments=T segments = path.split('/') else: segments = base_parts + path.split('/')

resolved_path = [] @@ -465,7 +469,7 @@ def urljoin(base, url, allow_fragments=T resolved_path.append('') return _coerce_result(urlunparse((scheme, netloc, '/'.join(

def urldefrag(url):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -137,6 +137,9 @@ Core and Builtins Library ------- +- Issue #22278: Fix urljoin problem with relative urls, a regression observed