-
Notifications
You must be signed in to change notification settings - Fork 1.3k
platform.python_implementation returning "CPython" #4111
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
Comments
Oh, thank you! it was a mistake. It will be great if you can try. @palaviv do you have advice? |
Comparing the last version of platform.py (prior to the 3.10.6 update) to the very first version (which matches the CPython version from late 2019), there are 3 areas with changes:
That should be easy enough for me to do to the 3.10.6 version. I can wait a bit to see if palaviv has any comments first. Regarding the old TODO's in there, I could take a closer look at those too and see if I can take care of them. I'm thinking it should be a separate PR so the "CPython" platform issue is fixed sooner rather than later. |
palaviv is not very active these days. You can go ahead as you want. Your analysis sounds very clear |
Ok, thanks. I have it ready. I'm not able to build at the moment, I think because of #4117? I'll submit the PR later... |
That must be not a problem when you build from project root. How it fails? |
Deleting code can mislead future update if the CPython code is updated - exactly what I thought. try:
from _platform import *
except ModuleNotFound:
# Add python function here This pattern will prevent it. |
I'll put the details in #4117. (Or let me know if it's better to open a new issue.) I see your platform.py change in #4128 -- is that just a temporary workaround, and I should still continue with the original change to platform.py I proposed (apply the 2020 changes to the new 3.10.6 version)?
Are you suggesting I take the code I was going to delete and put it in that except block? Just confirming. |
Python's platform.python_implementation function is now returning "CPython" instead of "RustPython". I believe it is because Lib/platform.py was refreshed recently (2daddd9) with the latest from CPython, which contains the python_implementation function. Previously, that function (among other things) had been removed from Lib/platform.py back in 2020 (bbb04c3) so that the Rust version of that function in stdlib/src/platform.rs would handle the implementation.
I noticed this because it breaks whats_left.py. (There's a check to make sure the sub-process isn't running CPython, and it now thinks it is, even though it's from "cargo run...".)
I can work on a PR, but I wasn't sure if there's more to this, like other related changes in the works or whatever. If not, I could bascially mimic what was done in bbb04c3. Let me know if I can help.
The text was updated successfully, but these errors were encountered: