Skip to content

Differentiate sys.implementation.version from sys.version_info #7770

Closed

Description

@TwelveBaud

Feature

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

https://docs.python.org/3/library/sys.html#sys.implementation

Activity

  1. added
    C-compatA discrepancy between RustPython and CPython
    on May 3, 2026
  2. joshuamegnauth54 commented on May 6, 2026

    @joshuamegnauth54
    Contributor

    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.

  3. youknowone commented on May 6, 2026

    @youknowone
    Member

    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

  4. added 3 commits that reference this issue on May 6, 2026
    27c3960
    f5719e2
    8501a01
  5. added a commit that references this issue on May 9, 2026
    3bab7a9
  6. added a commit that references this issue on Sep 16, 2026
    d72a726
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-compatA discrepancy between RustPython and CPython

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions