https://github.com/python/cpython/commit/ad101c3b30720bea1813da3d19ab2e939643ddb1
commit: ad101c3b30720bea1813da3d19ab2e939643ddb1
branch: main
author: Steve Dower <[email protected]>
committer: zooba <[email protected]>
date: 2026-10-22T21:47:14+01:00
summary:

gh-159494: Fixes PyManager package filename creation for non-standard 
free-threaded packages (GH-160263)

files:
M PC/layout/support/pymanager.py

diff --git a/PC/layout/support/pymanager.py b/PC/layout/support/pymanager.py
index f6316e0295c74af..b3975ee9e914e37 100644
--- a/PC/layout/support/pymanager.py
+++ b/PC/layout/support/pymanager.py
@@ -41,6 +41,8 @@ def calculate_install_json(ns, *, for_embed=False, 
for_test=False):
     ALIAS_PREFIX = "python"
     ALIAS_WPREFIX = "pythonw"
     FILE_PREFIX = "python-"
+    # Notice that FILE_SUFFIX may have more bits added to it below, and these
+    # are sensitive to ordering (for compatibility), so don't change the order!
     FILE_SUFFIX = f"-{ns.arch}"
     DISPLAY_TAGS = [{
         "win32": "32-bit",
@@ -52,7 +54,7 @@ def calculate_install_json(ns, *, for_embed=False, 
for_test=False):
         # Packages with the test suite come under a different Company
         COMPANY = "PythonTest"
         DISPLAY_TAGS.append("with tests")
-        FILE_SUFFIX = f"-test-{ns.arch}"
+        FILE_SUFFIX = f"-test{FILE_SUFFIX}"
     if for_embed:
         # Embeddable distro comes under a different Company
         COMPANY = "PythonEmbed"
@@ -62,15 +64,15 @@ def calculate_install_json(ns, *, for_embed=False, 
for_test=False):
         DISPLAY_TAGS.append("embeddable")
         # Deliberately name the file differently from the existing distro
         # so we can republish old versions without replacing files.
-        FILE_SUFFIX = f"-embeddable-{ns.arch}"
+        FILE_SUFFIX = f"-embeddable{FILE_SUFFIX}"
     if ns.include_freethreaded:
         # Free-threaded distro comes with a tag suffix
         TAG_SUFFIX = "t"
         if not ns.include_alias:
             TARGET = f"python{VER_MAJOR}.{VER_MINOR}t.exe"
-            TARGETW = f"pythonw{VER_MAJOR}.{VER_MINOR}t.exe"
+            TARGETW = f"pythonw{VER_MAJOR}.{VER_MINOR}t.exe" if TARGETW else 
None
         DISPLAY_TAGS.append("free-threaded")
-        FILE_SUFFIX = f"t-{ns.arch}"
+        FILE_SUFFIX = f"t{FILE_SUFFIX}"
 
     FULL_TAG = f"{VER_MAJOR}.{VER_MINOR}.{VER_MICRO}{VER_SUFFIX}{TAG_SUFFIX}"
     FULL_ARCH_TAG = f"{FULL_TAG}{TAG_ARCH}"

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to