Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Python 3.13.3 tarball and Git tag contain version 3.13.1 instead #133816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
f45tb00t opened this issue May 10, 2025 · 11 comments
Open

Python 3.13.3 tarball and Git tag contain version 3.13.1 instead #133816

f45tb00t opened this issue May 10, 2025 · 11 comments
Labels
3.13 bugs and security fixes build The build process and cross-build infra CI, GitHub Actions, buildbots, Dependabot, etc. pending The issue will be closed if no feedback is provided type-bug An unexpected behavior, bug, or error

Comments

@f45tb00t
Copy link

f45tb00t commented May 10, 2025

Bug report

Bug description:

Summary

The official Python 3.13.3 source archives (.tgz and .tar.xz) from https://python.org contain version 3.13.1 instead of 3.13.3. Additionally, the GitHub tag v3.13.3 in the cpython repository builds a Python binary that reports Python 3.13.1 when executed.

Steps to Reproduce

  1. Download Python-3.13.3.tgz from python.org.
  2. Build and install as usual (./configure && make && make altinstall).
  3. Run python3.13 --version → it says Python 3.13.1.

Also tested with:

  • Fresh clone of https://github.com/python/cpython.git
  • git checkout v3.13.3
  • Build cleanly from scratch

Result: Still reports Python 3.13.1.

Expected behavior

The built binary should report Python 3.13.3.

System

  • Tested on multiple Linux distributions
  • Confirmed SHA256 hash mismatch with expected one from python.org

CPython versions tested on:

3.13

Operating systems tested on:

Linux

@f45tb00t f45tb00t added the type-bug An unexpected behavior, bug, or error label May 10, 2025
@picnixz picnixz added infra CI, GitHub Actions, buildbots, Dependabot, etc. 3.13 bugs and security fixes labels May 10, 2025
@picnixz

This comment has been minimized.

@ronaldoussoren
Copy link
Contributor

Are you sure you're running the Python that was just build? The Include/patchlevel.h file in Python-3.13.3.tgz contains the right information:

/* Version parsed out into numeric values */
/*--start constants--*/
#define PY_MAJOR_VERSION        3
#define PY_MINOR_VERSION        13
#define PY_MICRO_VERSION        3
#define PY_RELEASE_LEVEL        PY_RELEASE_LEVEL_FINAL
#define PY_RELEASE_SERIAL       0

/* Version as a string */
#define PY_VERSION              "3.13.3"
/*--end constants--*/

@picnixz picnixz added the pending The issue will be closed if no feedback is provided label May 10, 2025
@picnixz
Copy link
Member

picnixz commented May 10, 2025

It might be a PATH issue (namely, the system-wide interpreter is being picked up before as you're doing altinstall). Check the output of which python3.13

@f45tb00t
Copy link
Author

f45tb00t commented May 10, 2025

Yes, I am quite sure.

The PATH is only set for a specifc user. I tried it even as root.
./usr/local/opt/python-3.13.3/bin/python3.13 --version
This showed v3.13.1

In fact also the sha256sum does not fit at all for me. Downloaded via wget and curl. Same result.

user@xyz:~/compile$ wget https://www.python.org/ftp/python/3.13.3/Python-3.13.3.tgz
--2025-05-10 15:42:14--  https://www.python.org/ftp/python/3.13.3/Python-3.13.3.tgz
Auflösen des Hostnamens www.python.org (www.python.org)… 151.101.64.223, 151.101.192.223, 151.101.128.223, ...
Verbindungsaufbau zu www.python.org (www.python.org)|151.101.64.223|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 29352716 (28M) [application/octet-stream]
Wird in »Python-3.13.3.tgz« gespeichert.

Python-3.13.3.tgz                               100%[=====================================================================================================>]  27,99M  11,4MB/s    in 2,5s    

2025-05-10 15:42:17 (11,4 MB/s) - »Python-3.13.3.tgz« gespeichert [29352716/29352716]

user@xyz:~/compile$ sha256sum Python-3.13.3.tgz 
988d735a6d33568cbaff1384a65cb22a1fb18a9ecb73d43ef868000193ce23ed  Python-3.13.3.tgz
user@xyz:~/compile$ date
Sa 10. Mai 15:42:37 CEST 2025

Then I tried to compile via git. Same issue.

Did exactly the same for the 3.13.2 (tarball) and it works like expected.

root@xyz:/usr/local/opt/python-3.13.3/bin# /usr/local/opt/python-3.13.2/bin/python3.13 --version
Python 3.13.2

@picnixz
Copy link
Member

picnixz commented May 10, 2025

That's extremely weird as https://github.com/python/cpython/blob/v3.13.3/Include/patchlevel.h has really 3.13.3. Is it the same for you? namely, when you git clone, are the sources the correct ones? also, perhaps try to do ./configure && make but do not install it. Then check ./python --version. Does it report the correct version? otherwise, the altinstall step may be incorrect.

What I can however remember is that we once had a similar issue where patchlevel.h was incorrectly picked and only the system-wide was used, namely the linker linked against the system-wide libpython3.13.so which could have been the one for 3.13.1 (I don't know why 3.13.2 works though)

@f45tb00t
Copy link
Author

But there is no system wide installation? In fact the installation of the Debian is not used at all. Its 3.11. So this does not interfere with the compiled one.

Yes, I checked the patchlevel, the version fitted. but after compiling and installing it was v3.13.1 using the created binary
I still had 3.13.1 installed, but not in any path, beside for one user and the venv.

I still dont get why the checksum differs from what you provide.

And yes, its very weird, that I used the same way for .2 and no issues at all.

@picnixz
Copy link
Member

picnixz commented May 10, 2025

Have you tried with the xz tarball instead? do the checksums also mismatch? Also try specifying --prefix=$(pwd)/build and do make altinstall. That way you're not installing in /usr/local. Maybe it's because /usr/local is in the include path and the you have some libpython in /usr/local?

@picnixz picnixz added the build The build process and cross-build label May 10, 2025
@ronaldoussoren
Copy link
Contributor

I've downloaded 3.13.3 using the tgz and did a build (without installing). Running from the build directory shows the correct version. Also the MD5 matches the checksum on the website, the SHA 256 checksum matches the checksum in the first message of this issue.

Is there a 3.13.1 installation on your machine? If so, check the Makefile for the 3.13.3 build for accidental references to that installation (for example in one of the CFLAGS variables).

What commands do you use to configure and build?

@ronaldoussoren
Copy link
Contributor

Also: Fedora already has an RPM for 3.13.3 , that makes it highly unlikely that our release artifacts and tags contain the incorrect version information (and that's ignoring the numerous tests that the release team does, the binary release artifacts are build from our source releases)

@f45tb00t
Copy link
Author

I have quite some installation.

I've used the same way as usual to compile and install it

ls -lah
insgesamt 40K
drwxr-xr-x 10 root root 4,0K 10. Mai 11:43 .
drwxr-xr-x 11 root root 4,0K 21. Apr 2021  ..
drwxr-xr-x  6 root root 4,0K  8. Dez 2022  python-3.10.9
drwxr-xr-x  6 root root 4,0K  9. Mär 2023  python-3.11.2
drwxr-xr-x  6 root root 4,0K  4. Apr 2024  python-3.12.2
drwxr-xr-x  6 root root 4,0K  8. Dez 16:56 python-3.13.1
drwxr-xr-x  6 root root 4,0K 10. Mai 11:43 python-3.13.2
drwxr-xr-x  6 root root 4,0K 10. Mai 11:19 python-3.13.3
drwxr-xr-x  6 root root 4,0K 21. Apr 2021  python-3.8.9
drwxr-xr-x  6 root root 4,0K  5. Nov 2021  python-3.9.7

Thats usually how I do it. It worked the same way for any installation you find above.

./configure --prefix=/usr/local/opt/python-3.13.3 --enable-optimizations --enable-loadable-sqlite-extensions --enable-shared
make -j$(nproc)
sudo make install

@ronaldoussoren
Copy link
Contributor

This is almost certainly an issue on your machine. @picnixz and I checked our release in a number of ways and it looks correct.

Some things to check:

  • Fully clean remove your build directory (reextract the tar archive in a fresh folder, or use a fresh checkout), and /usr/local/opt/python-3.13.3 (just to ensure you don't mix two builds)
  • Check if Include/patchlevel.h contains the right version information
  • Check if there's a patchlevel.h file in /usr/local
  • Run configure --prefix=/usr/local/opt/python-3.13.3 && make
  • Check if "./python -V" reports the correct version
  • If that version is correct: rebuild using the full set of configure flags you normally use and check again
  • If the version is not correct:
    • Check if there's a patchlevel.h or "Python.h" file in any include directory mentioned in the Makefile (-I flags)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes build The build process and cross-build infra CI, GitHub Actions, buildbots, Dependabot, etc. pending The issue will be closed if no feedback is provided type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants