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