(url, start=0)
| 411 | return url[:i], url[i+1:] |
| 412 | |
| 413 | def _splitnetloc(url, start=0): |
| 414 | delim = len(url) # position of end of domain part of url, default is end |
| 415 | for c in '/?#': # look for delimiters; the order is NOT important |
| 416 | wdelim = url.find(c, start) # find first of this delim |
| 417 | if wdelim >= 0: # if found |
| 418 | delim = min(delim, wdelim) # use earliest delim position |
| 419 | return url[start:delim], url[delim:] # return (domain, rest) |
| 420 | |
| 421 | def _checknetloc(netloc): |
| 422 | if not netloc or netloc.isascii(): |