Repository navigation
Conversation
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).
There was a problem hiding this comment.
🟡 Changes recommended
Failed downloads can leave truncated images that subsequent setup attempts incorrectly reuse as valid cached images.
1 open issue
What changed in this PR
Replaces the obsolete Python wget dependency with curl for VM image downloads, addressing the Python 3.14 import failure affecting kernel-tools workflows.
Changes:
- Uses
LocalCommand.run()to invoke curl with HTTP-error handling and redirect support. - Removes the
python3-wgetimport and package dependency.
| File | Description |
|---|---|
pyproject.toml |
Removes the obsolete python3-wget dependency. |
kt/ktlib/vm.py |
Switches VM image downloads from Python wget to curl. |
Review effort: Balanced
|
|
||
| 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)]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
GitHub's
ubuntu-latestmigrated to Ubuntu 26 on 2026-10-19, where systempython3is 3.14. This broke the kernel-tools CVE remediation workflows (kt list-kernelsetc.) with:Root cause:
kt/ktlib/vm.pyuses thepython3-wgetpackage, whose only release is 0.0.2-beta1 from January 2017. It subclassesurllib.request.FancyURLopener, which was removed in Python 3.14. The package is dead upstream, so there is no version to bump to — the usage must be replaced.Example failing run: https://github.com/ctrliq/kernel-tools/actions/runs/39555672007/job/120116391062
Changes
kt/ktlib/vm.py: droppedimport wget;_download_source_image()now usesLocalCommand.run(command=["curl", "-fL", ...]), matching the existing curl-via-LocalCommand pattern inkt/commands/content_release/impl.py-fpreserves wget's fail-on-HTTP-error behavior (no more writing a 404 page into the qcow2)-Lfollows redirects (wget default)pyproject.toml: removedpython3-wget(transitively dropshurry.filesize,cli-exit-tools,lib-detect-testenv)Verification
pip install -e .[dev]resolves cleanly with nopython3-wgetin the treepytest: 118 passedfrom kt.kt import main) +kt --help: OK in a venv with no wget installed at allruff check+ruff format --checkclean with the pre-commit-pinned ruff 0.15.19Notes
kernel_install_dep.shreferences the shellwgetCLI binary installed inside test VMs — unrelated, untouchedpyproject.toml+src_tree_tools_refin the CVE remediation workflows) and needs a pin bump once this mergesCoverage Report