[FIX] impossible to specify a version, like 3.14.2 or 3.15.0a7 #2

Merged
mdk merged 1 commit from merwyn/compile-python:main into main 2026-04-07 08:36:26 +02:00
Contributor

Hi!

I found a bug that prevents me from installing a specific version of Python.

$ bash --version
GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu)

Before the fix:

$ compile-python 3.15.0a6

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Version not found, check on https://www.python.org/ftp/python.

$ . ~/.bashrc; compile-python 3.14.3

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Version not found, check on https://www.python.org/ftp/python.

After:

$ . ~/.bashrc; compile-python 3.15.0a6
Get version 3.15.0a6
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for Python interpreter freezing... ./_bootstrap_python
checking for python3.15... python3.15
checking Python for regen version... Python 3.15.0a6
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
...

$ compile-python 3.14.3
Get version 3.14.3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for Python interpreter freezing... ./_bootstrap_python
checking for python3.14... python3.14
checking Python for regen version... Python 3.14.3
...

The only slightly annoying thing about this fix is that if you request a specific version but it doesn't exist, the code will default to the latest version of the requested release.

That's why I added the information about the release selected by the script.

$ . ~/.bashrc; compile-python 3.15.0a8
Get version 3.15.0a7
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for Python interpreter freezing... ./_bootstrap_python
checking for python3.15... python3.15
checking Python for regen version... Python 3.15.0a6
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
Hi! I found a bug that prevents me from installing a specific version of Python. ```shell $ bash --version GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu) ``` Before the fix: ```shell $ compile-python 3.15.0a6 gzip: stdin: unexpected end of file tar: Child returned status 1 tar: Error is not recoverable: exiting now Version not found, check on https://www.python.org/ftp/python. $ . ~/.bashrc; compile-python 3.14.3 gzip: stdin: unexpected end of file tar: Child returned status 1 tar: Error is not recoverable: exiting now Version not found, check on https://www.python.org/ftp/python. ``` After: ```shell $ . ~/.bashrc; compile-python 3.15.0a6 Get version 3.15.0a6 checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for Python interpreter freezing... ./_bootstrap_python checking for python3.15... python3.15 checking Python for regen version... Python 3.15.0a6 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes ... $ compile-python 3.14.3 Get version 3.14.3 checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for Python interpreter freezing... ./_bootstrap_python checking for python3.14... python3.14 checking Python for regen version... Python 3.14.3 ... ``` The only slightly annoying thing about this fix is that if you request a specific version but it doesn't exist, the code will default to the latest version of the requested release. That's why I added the information about the release selected by the script. ```shell $ . ~/.bashrc; compile-python 3.15.0a8 Get version 3.15.0a7 checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for Python interpreter freezing... ./_bootstrap_python checking for python3.15... python3.15 checking Python for regen version... Python 3.15.0a6 checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes ```
@ -34,3 +36,3 @@
sed "s/^>//;s|/<$||" |
sort --sort=version |
grep "^$PY_VERSION\." |
grep "^$PY_VERSION\.\?" |
Owner

I'm not sure about the \?, if the idea is to make the dot optional, why not just removing the dot?

I'm not sure about the `\?`, if the idea is to make the dot optional, why not just removing the dot?
Author
Contributor

So true, sorry.
It just not poped in my mind when I change it.

Fixed

So true, sorry. It just not poped in my mind when I change it. Fixed
@ -54,12 +56,23 @@ get-python-version-suffix()
# a5
local VERSION="$1"
local USER_INPUT_VERSION="$2"
Owner

Please add at least one example about the usage of the 2nd arg in the function "docstring".

Please add at least one example about the usage of the 2nd arg in the function "docstring".
Author
Contributor

Done, I wrote some explanations :)

Done, I wrote some explanations :)
mdk merged commit 634608bf6c into main 2026-03-27 19:44:22 +01:00
Owner

Merci !

Merci !
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mdk/compile-python!2
No description provided.