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

bpo-44113: Deprecate old functions to config Python init #26060

Merged
merged 1 commit into from May 12, 2021

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented May 12, 2021

Deprecate the following functions to configure the Python
initialization:

  • PySys_AddWarnOption()
  • PySys_AddWarnOptionUnicode()
  • PySys_AddXOption()
  • PySys_HasWarnOptions()
  • Py_SetPath()
  • Py_SetProgramName()
  • Py_SetPythonHome()
  • Py_SetStandardStreamEncoding()
  • _Py_SetProgramFullPath()

Use the new PyConfig API of the Python Initialization Configuration
instead (PEP 587).

https://bugs.python.org/issue44113

@corona10
Copy link
Member

@corona10 corona10 commented May 12, 2021

@vstinner

Don't we have to change the signature of API like this?

from Include/sysmodule.h

Py_DEPRECATED(3.11) PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *);
@vstinner vstinner force-pushed the vstinner:deprecate_py_set branch from 83dc745 to ee61be5 May 12, 2021
@vstinner
Copy link
Member Author

@vstinner vstinner commented May 12, 2021

@corona10: Oh right, I added Py_DEPRECATED().

I rebased my PR and also deprecated PySys_HasWarnOptions().

Deprecate the following functions to configure the Python
initialization:

* PySys_AddWarnOption()
* PySys_AddWarnOptionUnicode()
* PySys_AddXOption()
* PySys_HasWarnOptions()
* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Use the new PyConfig API of the Python Initialization Configuration
instead (PEP 587).
@vstinner vstinner force-pushed the vstinner:deprecate_py_set branch from ee61be5 to 6ea50fe May 12, 2021
@vstinner
Copy link
Member Author

@vstinner vstinner commented May 12, 2021

I also deprecated the undocumented _Py_SetProgramFullPath() function.

@vstinner
Copy link
Member Author

@vstinner vstinner commented May 12, 2021

@corona10: Would you mind to review the updated PR?

Copy link
Member

@corona10 corona10 left a comment

lgtm

@vstinner vstinner merged commit 6cd0446 into python:main May 12, 2021
12 checks passed
12 checks passed
@github-actions
Docs Docs
Details
@github-actions
Check for source changes
Details
@github-actions
Check if generated files are up to date
Details
@github-actions
Windows (x86)
Details
@github-actions
Windows (x64) Windows (x64)
Details
@github-actions
macOS
Details
@github-actions
Ubuntu Ubuntu
Details
@github-actions
Ubuntu SSL tests with OpenSSL
Details
Azure Pipelines PR #20210512.52 succeeded
Details
@travis-ci
Travis CI - Pull Request Build Passed
Details
@bedevere-bot
bedevere/issue-number Issue number 44113 found
Details
@bedevere-bot
bedevere/news News entry found in Misc/NEWS.d
@vstinner vstinner deleted the vstinner:deprecate_py_set branch May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants