Removes any existing fragment from URL. Returns a tuple of the defragmented URL and the fragment. If the URL contained no fragments, the second element is the empty string.
(url)
| 606 | |
| 607 | |
| 608 | def urldefrag(url): |
| 609 | """Removes any existing fragment from URL. |
| 610 | |
| 611 | Returns a tuple of the defragmented URL and the fragment. If |
| 612 | the URL contained no fragments, the second element is the |
| 613 | empty string. |
| 614 | """ |
| 615 | url, _coerce_result = _coerce_args(url) |
| 616 | if '#' in url: |
| 617 | s, n, p, a, q, frag = urlparse(url) |
| 618 | defrag = urlunparse((s, n, p, a, q, '')) |
| 619 | else: |
| 620 | frag = '' |
| 621 | defrag = url |
| 622 | return _coerce_result(DefragResult(defrag, frag)) |
| 623 | |
| 624 | _hexdig = '0123456789ABCDEFabcdef' |
| 625 | _hextobyte = None |
nothing calls this directly
no test coverage detected