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)
| 650 | |
| 651 | |
| 652 | def urldefrag(url): |
| 653 | """Removes any existing fragment from URL. |
| 654 | |
| 655 | Returns a tuple of the defragmented URL and the fragment. If |
| 656 | the URL contained no fragments, the second element is the |
| 657 | empty string. |
| 658 | """ |
| 659 | url, _coerce_result = _coerce_args(url) |
| 660 | if '#' in url: |
| 661 | s, n, p, q, frag = _urlsplit(url) |
| 662 | defrag = _urlunsplit(s, n, p, q, None) |
| 663 | else: |
| 664 | frag = '' |
| 665 | defrag = url |
| 666 | return _coerce_result(DefragResult(defrag, frag or '')) |
| 667 | |
| 668 | _hexdig = '0123456789ABCDEFabcdef' |
| 669 | _hextobyte = None |
nothing calls this directly
no test coverage detected