MCPcopy Index your code
hub / github.com/RustPython/RustPython / urlunparse

Function urlunparse

Lib/urllib/parse.py:533–548  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

531 return (scheme, netloc, url, query, fragment)
532
533def 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
550def urlunsplit(components):
551 """Combine the elements of a tuple as returned by urlsplit() into a

Callers 3

http_error_302Method · 0.90
geturlMethod · 0.85
geturlMethod · 0.85

Calls 2

_coerce_argsFunction · 0.85
_urlunsplitFunction · 0.85

Tested by

no test coverage detected