You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Differentiate sys.implementation.version from sys.version_info #7770
I'm writing an application that runs a third-party script, which operates on pickles generated by another application. There are different versions of the script for Python 2 and Python 3, and the Python version must match the Python version used by that other application, but the actual implementation doesn't matter -- CPy, RustPy, Jython, IronPy, and PyPy all work properly.
My application allows the user to choose their Python executable of choice. It needs to check whether it implements Python 2 or Python 3 and also collect and show a proof-of-life (i.e. "RustPython 0.5.0 (64bit, for Python 3.14)"). Usually I'd get that from PEP514 registrations, but I also need to generate it if someone browses to an unregistered interpreter like RustPython. I'm getting incorrect output from RustPython when I try to obtain that information.
There are two version numbers in sys, and RustPython incorrectly uses the same version information in both:
sys.version_info -- This is the version of CPython that RustPython is trying to copy, and is correctly set to (essentially) 3.14.0alpha.
sys.implementation.version -- This is the version of RustPython itself. It should be set to (essentially) 0.5.0, but instead is set to the same version as above.
Python Documentation or reference to CPython source code
Thanks for the report! I started working on this. It's a reasonably easy fix since Cargo exposes the version info I need.
If you find any more discrepancies between RustPython and other implementation, especially CPython, feel free to report them. 😺 I've been trying to find some as well so I could work on them.
Activity
joshuamegnauth54 commentedon May 6, 2026
Thanks for the report! I started working on this. It's a reasonably easy fix since Cargo exposes the version info I need.
If you find any more discrepancies between RustPython and other implementation, especially CPython, feel free to report them. 😺 I've been trying to find some as well so I could work on them.
youknowone commentedon May 6, 2026
Thank you for the report!
@joshuamegnauth54 just in case, if you are looking for tasks, searching "TODO: RUSTPYTHON" under Lib/test/ are all the differences
Fix sys.implementation
Fix sys.implementation
Fix sys.implementation
Fix sys.implementation (#7793)
Fix sys.implementation (#7793)