Skip to content

bpo-36763: Use PyConfig_Clear() #14445

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

Merged
merged 1 commit into from
Jul 1, 2019
Merged

bpo-36763: Use PyConfig_Clear() #14445

merged 1 commit into from
Jul 1, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 28, 2019

Stop using "static PyConfig", PyConfig must now always use
dynamically allocated strings: use PyConfig_SetString(),
PyConfig_SetArgv() and PyConfig_Clear().

https://bugs.python.org/issue36763

@vstinner vstinner changed the title bpo-36763: Use PyConfig_Clear() [WIP] bpo-36763: Use PyConfig_Clear() Jun 28, 2019
@vstinner
Copy link
Member Author

This PR depends on PR #14444 to add PyConfig_SetWideStringList().

@brettcannon
Copy link
Member

The title says this is about PyConfig_Clear() but most of the changes in the PR revolve around PyConfig_SetWideStringList(). Is the title accurate?

@vstinner
Copy link
Member Author

vstinner commented Jul 1, 2019

The title says this is about PyConfig_Clear() but most of the changes in the PR revolve around PyConfig_SetWideStringList(). Is the title accurate?

To be able to use PyConfig_Clear(), as "required" by the PEP 587, you have to use dynamically allocated memory, and so the code has to be modified to use PyConfig_SetWideStringList() instead of static strings.

This change depends on PR #14444: we need a PyConfig_SetWideStringList() function, otherwise, it's harder to use set warnoptions and xoptions fields of PyConfig.

Stop using "static PyConfig", PyConfig must now always use
dynamically allocated strings: use PyConfig_SetString(),
PyConfig_SetArgv() and PyConfig_Clear().
@vstinner vstinner changed the title [WIP] bpo-36763: Use PyConfig_Clear() bpo-36763: Use PyConfig_Clear() Jul 1, 2019
@vstinner
Copy link
Member Author

vstinner commented Jul 1, 2019

This change should be backported to 3.8 once PR #14523 is merged.

@vstinner vstinner merged commit 6731002 into python:master Jul 1, 2019
@vstinner vstinner deleted the init_clean branch July 1, 2019 17:52
@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 1, 2019
Stop using "static PyConfig", PyConfig must now always use
dynamically allocated strings: use PyConfig_SetString(),
PyConfig_SetArgv() and PyConfig_Clear().
(cherry picked from commit 6731002)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-bot
Copy link

GH-14528 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Jul 1, 2019
Stop using "static PyConfig", PyConfig must now always use
dynamically allocated strings: use PyConfig_SetString(),
PyConfig_SetArgv() and PyConfig_Clear().
(cherry picked from commit 6731002)

Co-authored-by: Victor Stinner <[email protected]>
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
Stop using "static PyConfig", PyConfig must now always use
dynamically allocated strings: use PyConfig_SetString(),
PyConfig_SetArgv() and PyConfig_Clear().
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Stop using "static PyConfig", PyConfig must now always use
dynamically allocated strings: use PyConfig_SetString(),
PyConfig_SetArgv() and PyConfig_Clear().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants