diff --git a/pythonbuild/downloads.json b/pythonbuild/downloads.json index 4d19a1579..a02d201bb 100644 --- a/pythonbuild/downloads.json +++ b/pythonbuild/downloads.json @@ -102,10 +102,10 @@ "python_tag": "cp314" }, "cpython-3.15": { - "url": "https://www.python.org/ftp/python/3.15.0/Python-3.15.0rc2.tar.xz", - "size": 35544464, - "sha256": "8d93af5eaaaea5adfd41bd786a7ba3f03f2ad1ab57c6a65e0b963deab91d5ad7", - "version": "3.15.0rc2", + "url": "https://github.com/python/cpython/archive/55634044b61fec74af2114ff6390b7c84bd21bbf.tar.gz", + "size": 44376986, + "sha256": "8ecf4043ce1243b9f09786b732cf1ac6450e4992e480b330058783b9bd28a2e6", + "version": "3.15.0", "licenses": [ "Python-2.0", "CNRI-Python" diff --git a/pythonbuild/utils.py b/pythonbuild/utils.py index a599925aa..541e9b899 100644 --- a/pythonbuild/utils.py +++ b/pythonbuild/utils.py @@ -399,6 +399,21 @@ def download_entry(key: str, dest_path: pathlib.Path, local_name=None) -> pathli local_path = dest_path / (local_name or url[url.rindex("/") + 1 :]) download_to_path(url, local_path, size, sha256) + if key == "cpython-3.15": + repacked = dest_path / f"Python-{entry['version']}.tar.xz" + with tarfile.open(local_path) as source: + with tarfile.open(repacked, "w:xz", preset=0) as output: + for member in source: + content = source.extractfile(member) if member.isfile() else None + member.name = ( + f"Python-{entry['version']}/{member.name.partition('/')[2]}" + ) + member.pax_headers = {} + output.addfile(member, content) + if content is not None: + content.close() + local_path = repacked + return local_path