diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 0b96b5b41d3..ffb0ff72dfe 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -221,6 +221,11 @@ def urlunparse(components): return urlunsplit((scheme, netloc, url, query, fragment)) def urlunsplit(components): + """Combine the elements of a tuple as returned by urlsplit() into a + complete URL as a string. The data argument can be any five-item iterable. + This may result in a slightly different, but equivalent URL, if the URL that + was parsed originally had unnecessary delimiters (for example, a ? with an + empty query; the RFC states that these are equivalent).""" scheme, netloc, url, query, fragment = components if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'): if url and url[:1] != '/': url = '/' + url