Skip to content

Commit 507c754

Browse files
committed
[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).
1 parent c0b051c commit 507c754

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

‎kt/ktlib/vm.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import time
66
from dataclasses import dataclass
77

8-
import wget
98
from git import Repo
109
from pathlib3x import Path
1110
from ruamel.yaml import YAML
@@ -202,7 +201,7 @@ def _download_source_image(self, override_base: bool = False):
202201
self.qcow2_source_path.unlink(missing_ok=True)
203202

204203
logging.info(f"Downloading image from {self._get_vm_url()}")
205-
wget.download(self._get_vm_url(), out=str(self.qcow2_source_path))
204+
LocalCommand.run(command=["curl", "-fL", self._get_vm_url(), "-o", str(self.qcow2_source_path)])
206205

207206
def _is_centos7(self) -> bool:
208207
return bool(self.os_variant and self.os_variant.startswith("centos7"))

‎pyproject.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies = [
88
"gitpython",
99
"click",
1010
"pathlib3x",
11-
"python3-wget",
1211
"ruamel.yaml",
1312
"pyyaml",
1413
"pexpect",

0 commit comments

Comments
 (0)