|
44 | 44 | 'imap', 'wais', 'file', 'mms', 'https', 'shttp', |
45 | 45 | 'snews', 'prospero', 'rtsp', 'rtspu', 'rsync', '', |
46 | 46 | 'svn', 'svn+ssh', 'sftp', 'nfs', 'git', 'git+ssh'] |
47 | | -non_hierarchical = ['gopher', 'hdl', 'mailto', 'news', |
48 | | - 'telnet', 'wais', 'imap', 'snews', 'sip', 'sips'] |
49 | 47 | uses_params = ['ftp', 'hdl', 'prospero', 'http', 'imap', |
50 | 48 | 'https', 'shttp', 'rtsp', 'rtspu', 'sip', 'sips', |
51 | 49 | 'mms', '', 'sftp'] |
52 | | -uses_query = ['http', 'wais', 'imap', 'https', 'shttp', 'mms', |
53 | | - 'gopher', 'rtsp', 'rtspu', 'sip', 'sips', ''] |
54 | | -uses_fragment = ['ftp', 'hdl', 'http', 'gopher', 'news', |
55 | | - 'nntp', 'wais', 'https', 'shttp', 'snews', |
56 | | - 'file', 'prospero', ''] |
57 | 50 |
|
58 | 51 | # Characters valid in scheme names |
59 | 52 | scheme_chars = ('abcdefghijklmnopqrstuvwxyz' |
@@ -357,9 +350,9 @@ def urlsplit(url, scheme='', allow_fragments=True): |
357 | 350 | if (('[' in netloc and ']' not in netloc) or |
358 | 351 | (']' in netloc and '[' not in netloc)): |
359 | 352 | raise ValueError("Invalid IPv6 URL") |
360 | | - if allow_fragments and scheme in uses_fragment and '#' in url: |
| 353 | + if allow_fragments and '#' in url: |
361 | 354 | url, fragment = url.split('#', 1) |
362 | | - if scheme in uses_query and '?' in url: |
| 355 | + if '?' in url: |
363 | 356 | url, query = url.split('?', 1) |
364 | 357 | v = SplitResult(scheme, netloc, url, query, fragment) |
365 | 358 | _parse_cache[key] = v |
|
0 commit comments