Skip to content

bpo-40910: Export Py_GetArgcArgv() function #20721

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 2 commits into from
Jun 8, 2020
Merged

bpo-40910: Export Py_GetArgcArgv() function #20721

merged 2 commits into from
Jun 8, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 8, 2020

Export explicitly the Py_GetArgcArgv() function to the C API and
document the function. Previously, it was exported implicitly which
no longer works since Python is built with -fvisibility=hidden.

  • Add PyConfig._orig_argv member.
  • Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
  • PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
    _PyConfig_Write() responsibility.
  • _PyConfig_Write() result type becomes PyStatus instead of void.
  • Write an unit test on Py_GetArgcArgv().

https://bugs.python.org/issue40910

Export explicitly the Py_GetArgcArgv() function to the C API and
document the function. Previously, it was exported implicitly which
no longer works since Python is built with -fvisibility=hidden.

* Add PyConfig._orig_argv member.
* Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
* PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
  _PyConfig_Write() responsibility.
* _PyConfig_Write() result type becomes PyStatus instead of void.
* Write an unit test on Py_GetArgcArgv().
@vstinner
Copy link
Member Author

vstinner commented Jun 8, 2020

This PR should be backport manually to Python 3.9: "python310" must be replaced with "python39" in PC/python3.def.

@vstinner vstinner merged commit e81f6e6 into python:master Jun 8, 2020
@vstinner vstinner deleted the get_argc_argv branch June 8, 2020 16:13
vstinner added a commit that referenced this pull request Jun 8, 2020
Export explicitly the Py_GetArgcArgv() function to the C API and
document the function. Previously, it was exported implicitly which
no longer works since Python is built with -fvisibility=hidden.

* Add PyConfig._orig_argv member.
* Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
* PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
  _PyConfig_Write() responsibility.
* _PyConfig_Write() result type becomes PyStatus instead of void.
* Write an unit test on Py_GetArgcArgv().

(cherry picked from commit e81f6e6)
arun-mani-j pushed a commit to arun-mani-j/cpython that referenced this pull request Jul 21, 2020
Export explicitly the Py_GetArgcArgv() function to the C API and
document the function. Previously, it was exported implicitly which
no longer works since Python is built with -fvisibility=hidden.

* Add PyConfig._orig_argv member.
* Py_InitializeFromConfig() no longer calls _PyConfig_Write() twice.
* PyConfig_Read() no longer initializes Py_GetArgcArgv(): it is now
  _PyConfig_Write() responsibility.
* _PyConfig_Write() result type becomes PyStatus instead of void.
* Write an unit test on Py_GetArgcArgv().
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.

3 participants