(url, start=0)
| 499 | return url[:i], url[i+1:] |
| 500 | |
| 501 | def _splitnetloc(url, start=0): |
| 502 | delim = len(url) # position of end of domain part of url, default is end |
| 503 | for c in '/?#': # look for delimiters; the order is NOT important |
| 504 | wdelim = url.find(c, start) # find first of this delim |
| 505 | if wdelim >= 0: # if found |
| 506 | delim = min(delim, wdelim) # use earliest delim position |
| 507 | return url[start:delim], url[delim:] # return (domain, rest) |
| 508 | |
| 509 | def _checknetloc(netloc): |
| 510 | if not netloc or netloc.isascii(): |