Skip to content
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

Fix Py_UnbufferedStdioFlag deprecation warning #3265

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BsAtHome
Copy link
Contributor

The use of Py_UnbufferedStdioFlag has been deprecated in python 3.12 (current debian:sid and other distros) and will be removed in 3.14. This PR fixes the warning (see also: #3203) and also fixes additional problems with the PyConfig code.

@rene-dev: The python documentation states that you need to use Py_InitializeFromConfig() when you change the PyConfig and you need to release the configuration with PyConfig_Clear() (see: https://docs.python.org/3.12/c-api/init_config.html#initialization-with-pyconfig).

Note: the merging #2487 to fix a previous deprecation warning introducing use of PyConfig caused all python versions lower than 3.8 to fail or anything older than Bullseye (see https://wiki.debian.org/Python). Therefore, no CPP conditional are placed around the code to support older distributions.

Fix python initialization using config.
Fix releasing python config after use.
@rene-dev rene-dev self-assigned this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants