MCPcopy Index your code
hub / github.com/python/cpython / _splitnetloc

Function _splitnetloc

Lib/urllib/parse.py:501–507  ·  view source on GitHub ↗
(url, start=0)

Source from the content-addressed store, hash-verified

499 return url[:i], url[i+1:]
500
501def _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
509def _checknetloc(netloc):
510 if not netloc or netloc.isascii():

Callers 1

_urlsplitFunction · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…