diff -r 4cdd5c99c4eb Lib/test/test_urlparse.py --- a/Lib/test/test_urlparse.py Sat Nov 20 15:09:23 2010 -0500 +++ b/Lib/test/test_urlparse.py Sat Nov 20 15:19:06 2010 -0500 @@ -244,6 +244,7 @@ # Test cases from RFC3986 self.checkJoin(RFC3986_BASE, '?y','http://a/b/c/d;p?y') self.checkJoin(RFC2396_BASE, ';x', 'http://a/b/c/;x') + self.checkJoin('http://a/b/c/de', ';x', 'http://a/b/c/;x') self.checkJoin(RFC3986_BASE, 'g:h','g:h') self.checkJoin(RFC3986_BASE, 'g','http://a/b/c/g') self.checkJoin(RFC3986_BASE, './g','http://a/b/c/g') diff -r 4cdd5c99c4eb Lib/urlparse.py --- a/Lib/urlparse.py Sat Nov 20 15:09:23 2010 -0500 +++ b/Lib/urlparse.py Sat Nov 20 15:19:06 2010 -0500 @@ -256,14 +256,10 @@ if path[:1] == '/': return urlunparse((scheme, netloc, path, params, query, fragment)) - if not path: + if not path and not params: path = bpath if not params: params = bparams - else: - path = path[:-1] - return urlunparse((scheme, netloc, path, - params, query, fragment)) if not query: query = bquery return urlunparse((scheme, netloc, path,