Skip to content

Commit 7e933de

Browse files
Copilotbytemain
andcommitted
Fix Windows 386 URL generation for Python installer downloads
Agent-Logs-Url: https://github.com/version-fox/vfox-python/sessions/c5007c2e-24f3-40ba-94a7-0eef5e0f3c31 Co-authored-by: bytemain <13938334+bytemain@users.noreply.github.com>
1 parent f00abf4 commit 7e933de

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

lib/util.lua

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ local REQUEST_HEADERS = {
2020

2121
-- download source
2222
local DOWNLOAD_SOURCE = {
23-
MSI = PYTHON_URL .. "%s/python-%s.%s.msi",
23+
MSI = PYTHON_URL .. "%s/python-%s%s.msi",
2424
EXE = PYTHON_URL .. "%s/python-%s%s.exe",
2525
SOURCE = PYTHON_URL .. "%s/Python-%s.tar",
2626
}
@@ -247,12 +247,15 @@ end
247247

248248
function getReleaseForWindows(version)
249249
local archType = RUNTIME.archType
250-
if archType == "386" then
251-
archType = ""
250+
local exeArchSuffix = ""
251+
local msiArchSuffix = ""
252+
if archType ~= "386" then
253+
exeArchSuffix = "-" .. archType
254+
msiArchSuffix = "." .. archType
252255
end
253256

254257
-- try get exe file
255-
local url = DOWNLOAD_SOURCE.EXE:format(version, version, '-' .. archType)
258+
local url = DOWNLOAD_SOURCE.EXE:format(version, version, exeArchSuffix)
256259
local resp, err = http.head({
257260
url = url,
258261
headers = REQUEST_HEADERS
@@ -262,7 +265,7 @@ function getReleaseForWindows(version)
262265
end
263266

264267
-- try get msi file
265-
local url = DOWNLOAD_SOURCE.MSI:format(version, version, archType)
268+
local url = DOWNLOAD_SOURCE.MSI:format(version, version, msiArchSuffix)
266269
local resp, err = http.head({
267270
url = url,
268271
headers = REQUEST_HEADERS

0 commit comments

Comments
 (0)