(url: str, timeout: int = 30)
| 16 | |
| 17 | @functools.cache |
| 18 | def 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 | |
| 38 | def retrieve_with_retries(download_location, output_path, reporthook, |
no test coverage detected
searching dependent graphs…