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

Function _splithost

tools/python-3.11.9-amd64/Lib/urllib/parse.py:1085–1097  ·  view source on GitHub ↗

splithost('//host[:port]/path') --> 'host[:port]', '/path'.

(url)

Source from the content-addressed store, hash-verified

1083
1084_hostprog = None
1085def _splithost(url):
1086 """splithost('//host[:port]/path') --> 'host[:port]', '/path'."""
1087 global _hostprog
1088 if _hostprog is None:
1089 _hostprog = re.compile('//([^/#?]*)(.*)', re.DOTALL)
1090
1091 match = _hostprog.match(url)
1092 if match:
1093 host_port, path = match.groups()
1094 if path and path[0] != '/':
1095 path = '/' + path
1096 return host_port, path
1097 return None, url
1098
1099
1100def splituser(host):

Callers 12

_parseMethod · 0.90
do_request_Method · 0.90
openMethod · 0.90
retrieveMethod · 0.90
_open_generic_httpMethod · 0.90
open_local_fileMethod · 0.90
open_ftpMethod · 0.90
retry_http_basic_authMethod · 0.90
splithostFunction · 0.85

Calls 3

compileMethod · 0.45
matchMethod · 0.45
groupsMethod · 0.45

Tested by

no test coverage detected