From 54916415567d1f7c3ba7a222f1d1acd1dfc425b4 Mon Sep 17 00:00:00 2001 From: Olivier Mauras <olivier@mauras.ch> Date: Wed, 18 Sep 2024 13:36:54 +0200 Subject: [PATCH] community/salt-lts: https://github.com/saltstack/salt/pull/66899 --- community/salt-lts/APKBUILD | 4 +- .../salt-lts/fix-urllib.parse-module.patch | 49 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 community/salt-lts/fix-urllib.parse-module.patch diff --git a/community/salt-lts/APKBUILD b/community/salt-lts/APKBUILD index e393fdf63c6b..1b5d70516ed3 100644 --- a/community/salt-lts/APKBUILD +++ b/community/salt-lts/APKBUILD @@ -4,7 +4,7 @@ # Maintainer: Will Sinatra <wpsinatra@gmail.com> pkgname=salt-lts pkgver=3006.9 -pkgrel=1 +pkgrel=2 pkgdesc="parallel remote execution system LTS Channel" url="https://github.com/saltstack/salt" arch="noarch" @@ -58,6 +58,7 @@ source="https://pypi.io/packages/source/s/salt/salt-$pkgver.tar.gz salt-syndic.initd match_hostname.patch ignore_deprecations.patch + fix-urllib.parse-module.patch " options="!check" # depends on pytestsalt builddir="$srcdir/salt-$pkgver" @@ -189,4 +190,5 @@ bafc6ea10cdafd0aef868feb35aecbe4ae6a7dff0ae42862bded85715ad763eb89e1ed27437866a7 d71133e834685304e0167554035ebbc861252f972bbe981cc71e45b70f15d94a28a02a369463c9a641372919689f96b62a0408b14f824ad986d536e52b1e5ec0 salt-syndic.initd eadc8b7242dca02a04b34dab185663b9c54f4fc3a3fb3f1f753c3e21442a5ce89005a4458f735ec80ee1a7f1ee56743c9374012d354ac4cf7ac6afd547bb4ee4 match_hostname.patch 575829a4cd5e4779e050794243f7a44452f3a6b00b2eabe6eafbb1b0b2b98b30ca505a586fb20c86828938b0bc602e0ad6fcda6add575b7cda4e6d0b87f626d0 ignore_deprecations.patch +d606c572ee92846a6b37cee6be961e2d29b2398f899a93fccdf822226e956cd1c11d397f1e34929658441598d489682a08c28dfc1fc941047f45af3e8edeacbd fix-urllib.parse-module.patch " diff --git a/community/salt-lts/fix-urllib.parse-module.patch b/community/salt-lts/fix-urllib.parse-module.patch new file mode 100644 index 000000000000..de65fc00f8b4 --- /dev/null +++ b/community/salt-lts/fix-urllib.parse-module.patch @@ -0,0 +1,49 @@ +From 187f1f6f3bf6e5f8da4f7029368ddd0967711ba9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= + <marmarek@invisiblethingslab.com> +Date: Wed, 18 Sep 2024 04:54:24 +0200 +Subject: [PATCH] Fix Python3.13 compatibility regarding urllib.parse module + +Python 3.13 fixed handling relative paths in urllib.parse module. +Specifically, relative file URL is now constructed as file:path instead +of converting it to absolute file:///path. This breaks +salt.utils.url.create which expects file:/// specifically. The mismatch +results in for example changing salt://top.sls into salt://.sls and thus +not finding the top file. + +Fix this by handling both prefixes. + +Relevant python change: https://github.com/python/cpython/issues/85110 +Fixes: #66898 +--- + changelog/66898.fixed.md | 1 + + salt/utils/url.py | 5 ++++- + 2 files changed, 5 insertions(+), 1 deletion(-) + create mode 100644 changelog/66898.fixed.md + +diff --git a/changelog/66898.fixed.md b/changelog/66898.fixed.md +new file mode 100644 +index 0000000000..2549d5e00e +--- /dev/null ++++ b/changelog/66898.fixed.md +@@ -0,0 +1 @@ ++Fixed Python 3.13 compatibility regarding urllib.parse module +diff --git a/salt/utils/url.py b/salt/utils/url.py +index 478d8e911c..6d7ea37e6d 100644 +--- a/salt/utils/url.py ++++ b/salt/utils/url.py +@@ -47,7 +47,10 @@ def create(path, saltenv=None): + + query = f"saltenv={saltenv}" if saltenv else "" + url = salt.utils.data.decode(urlunparse(("file", "", path, "", query, ""))) +- return "salt://{}".format(url[len("file:///") :]) ++ # urlunparse changed behavior in Python 3.13 ++ if url.startswith("file:///"): ++ return "salt://{}".format(url[len("file:///") :]) ++ return "salt://{}".format(url[len("file:") :]) + + + def is_escaped(url): +-- +2.46.0 + -- GitLab