MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _splitnetloc

Function _splitnetloc

tools/python-3.11.9-amd64/Lib/urllib/parse.py:413–419  ·  view source on GitHub ↗
(url, start=0)

Source from the content-addressed store, hash-verified

411 return url[:i], url[i+1:]
412
413def _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
421def _checknetloc(netloc):
422 if not netloc or netloc.isascii():

Callers 1

urlsplitFunction · 0.85

Calls 2

minFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected