Add 3 edits suggested from @epicfaace

This commit is contained in:
Open Close 2020-03-15 15:15:11 +09:00
parent 9cfe7c0d14
commit 40338d6d6f
2 changed files with 6 additions and 6 deletions

View File

@ -394,6 +394,10 @@ class UrlParseTestCase(unittest.TestCase):
# Test for issue9721
self.checkJoin('http://a/b/c/de', ';x','http://a/b/c/;x')
# Tests for issue39799: no base fragment
self.checkJoin('http://a/b#f', '', 'http://a/b')
self.checkJoin('http://a/b/#f', 'g', 'http://a/b/g')
def test_urljoins(self):
self.checkJoin(SIMPLE_BASE, 'g:h','g:h')
self.checkJoin(SIMPLE_BASE, 'http:g','http://a/b/c/g')
@ -449,9 +453,6 @@ class UrlParseTestCase(unittest.TestCase):
# issue 23703: don't duplicate filename
self.checkJoin('a', 'b', 'b')
# issue 39799: no base fragment (not compatible with RFC1808)
self.checkJoin('http://a/b#f', '', 'http://a/b')
def test_RFC2732(self):
str_cases = [
('http://Test.python.org:5432/foo/', 'test.python.org', 5432),

View File

@ -1,3 +1,2 @@
Fix ``urllib.parse.urljoin``
when ``base`` has fragment and ``url`` is blank
(Returns ``base`` without fragment, not ``base`` entirely).
Fix ``urllib.parse.urljoin``.
In RFC 3986, ``base``'s fragment is always discarded.