Put a parsed URL back together again. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).
(components)
| 531 | return (scheme, netloc, url, query, fragment) |
| 532 | |
| 533 | def urlunparse(components): |
| 534 | """Put a parsed URL back together again. This may result in a |
| 535 | slightly different, but equivalent URL, if the URL that was parsed |
| 536 | originally had redundant delimiters, e.g. a ? with an empty query |
| 537 | (the draft states that these are equivalent).""" |
| 538 | scheme, netloc, url, params, query, fragment, _coerce_result = ( |
| 539 | _coerce_args(*components)) |
| 540 | if not netloc: |
| 541 | if scheme and scheme in uses_netloc and (not url or url[:1] == '/'): |
| 542 | netloc = '' |
| 543 | else: |
| 544 | netloc = None |
| 545 | if params: |
| 546 | url = "%s;%s" % (url, params) |
| 547 | return _coerce_result(_urlunsplit(scheme or None, netloc, url, |
| 548 | query or None, fragment or None)) |
| 549 | |
| 550 | def urlunsplit(components): |
| 551 | """Combine the elements of a tuple as returned by urlsplit() into a |
no test coverage detected