Skip to content

gh-133644: Remove PySys_SetArgv* for 3.15 #136277

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
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

xuantengh
Copy link
Contributor

@xuantengh xuantengh commented Jul 4, 2025

Remove PySys_SetArgv and PySys_SetArgvEx.


📚 Documentation preview 📚: https://cpython-previews--136277.org.readthedocs.build/

@xuantengh xuantengh requested review from a team, encukou and ericsnowcurrently as code owners July 4, 2025 07:47
@xuantengh xuantengh changed the title Remove PySys_SetArgv* for 3.15 gh-133644: Remove PySys_SetArgv* for 3.15 Jul 4, 2025
Comment on lines 1338 to 1341
[function.PySys_SetArgv]
added = '3.2'
[function.PySys_SetArgvEx]
added = '3.2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't remove the entry here, we should just mark them as abi_only = true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which will preserve them in python3dll.c, which is the actual breaking change (or at least the one that can be easily seen in a source diff).

Arguably they should stay in the header files as well, possibly only when Py_LIMITED_API is set. The functionality can change if it needs to, though ideally wouldn't break every existing user.

@picnixz
Copy link
Member

picnixz commented Jul 4, 2025

Please check if there are projects in the wild that use this. See for instance the case of PyWeakRef_GetObject where we delayed the removal for now until less projects are using it. And also, we should coordinate with the compat project. Finally, add a section for this removal in What's New as well as possible fallbacks.

@xuantengh
Copy link
Contributor Author

xuantengh commented Jul 5, 2025

Please check if there are projects in the wild that use this.

I have some rough and preliminary search in GitHub and find some projects like:

still use these C functions.

I can have a more detail exploration for popular PyPI packages later.

@xuantengh
Copy link
Contributor Author

@picnixz I search the top 300 popular PyPI packages and find PySys_SetArgv appears in the following 2:

@picnixz
Copy link
Member

picnixz commented Jul 8, 2025

Well cython is a major project that we don't want to break. orjson is, iirc, simd-accelerated JSON so we don't want to break it either. They should first upgrade their code and then we'll remove the functions on our side I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment