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

@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label May 12, 2021
@corona10 corona10 self-requested a review May 12, 2021
@corona10
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member Author

vstinner commented May 12, 2021

I also deprecated the undocumented _Py_SetProgramFullPath() function.

@vstinner
Copy link
Member Author

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
@vstinner vstinner deleted the 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
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants