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

Function trigger_automatic_root_certificate_update

PCbuild/get_external.py:18–35  ·  view source on GitHub ↗
(url: str, timeout: int = 30)

Source from the content-addressed store, hash-verified

16
17@functools.cache
18def trigger_automatic_root_certificate_update(url: str, timeout: int = 30) -> None:
19 escaped_url = url.replace("'", "''")
20 try:
21 subprocess.run(
22 [
23 "powershell",
24 "-NoProfile",
25 "-Command",
26 f"Invoke-WebRequest -Uri '{escaped_url}'"
27 f" -UseBasicParsing -Method HEAD -MaximumRedirection 0"
28 f" -TimeoutSec {timeout}",
29 ],
30 check=True,
31 capture_output=True,
32 timeout=timeout + 5,
33 )
34 except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as e:
35 print(e)
36
37
38def retrieve_with_retries(download_location, output_path, reporthook,

Callers 1

retrieve_with_retriesFunction · 0.85

Calls 2

replaceMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…