From 7a2788d78daf51b506550515abd8faa4ae114f59 Mon Sep 17 00:00:00 2001 From: Jonathan Maple Date: Thu, 22 Oct 2026 18:30:10 -0400 Subject: [PATCH] [KT VM] Replace python3-wget with curl for VM image download python3-wget (last released 2017) subclasses urllib.request.FancyURLopener, which was removed in Python 3.14. This breaks the whole kt import chain (kt -> content_release -> vm) wherever python3-wget gets installed, e.g. GitHub runners on the new Ubuntu 26 images where python3 is 3.14: AttributeError: module 'urllib.request' has no attribute 'FancyURLopener' Use curl via LocalCommand.run instead, matching the existing pattern in kt/commands/content_release/impl.py. -f fails on HTTP errors (wget raised on those) and -L follows redirects (wget default). Also drops the dead python3-wget dependency and its transitive deps (hurry.filesize, cli-exit-tools, lib-detect-testenv). --- kt/ktlib/vm.py | 3 +-- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/kt/ktlib/vm.py b/kt/ktlib/vm.py index 457426c..b388e57 100644 --- a/kt/ktlib/vm.py +++ b/kt/ktlib/vm.py @@ -5,7 +5,6 @@ import time from dataclasses import dataclass -import wget from git import Repo from pathlib3x import Path from ruamel.yaml import YAML @@ -202,7 +201,7 @@ def _download_source_image(self, override_base: bool = False): self.qcow2_source_path.unlink(missing_ok=True) logging.info(f"Downloading image from {self._get_vm_url()}") - wget.download(self._get_vm_url(), out=str(self.qcow2_source_path)) + LocalCommand.run(command=["curl", "-fL", self._get_vm_url(), "-o", str(self.qcow2_source_path)]) def _is_centos7(self) -> bool: return bool(self.os_variant and self.os_variant.startswith("centos7")) diff --git a/pyproject.toml b/pyproject.toml index ac138d8..a1896f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,6 @@ dependencies = [ "gitpython", "click", "pathlib3x", - "python3-wget", "ruamel.yaml", "pyyaml", "pexpect",