classification
Title: Remove PyModule_GetWarningsModule() in pylifecycle.c
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: petr.viktorin, shihai1991, vstinner
Priority: normal Keywords: patch

Created on 2020-12-08 11:25 by shihai1991, last changed 2020-12-08 14:46 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 23691 merged shihai1991, 2020-12-08 11:34
Messages (6)
msg382727 - (view) Author: hai shi (shihai1991) * (Python triager) Date: 2020-12-08 11:25
PyModule_GetWarningsModule() of pylifecycle.c is useless when _warning module was converted to a builtin module in 2.6. So move it directly now is OK.
msg382728 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-12-08 11:28
It's not part of the C API and it's no longer exported in libpython since we (the default visibility was changed to "hidden"). IMHO it's safe to remove the function. But it would not harm to document the removal in https://docs.python.org/dev/whatsnew/3.10.html#id4 section.
msg382729 - (view) Author: hai shi (shihai1991) * (Python triager) Date: 2020-12-08 11:36
> But it would not harm to document the removal in https://docs.python.org/dev/whatsnew/3.10.html#id4 section.

Copy that. I will update it soon.
msg382730 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2020-12-08 12:00
When was the visibility changed to hidden?
msg382740 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-12-08 14:42
New changeset 0f91f586ae9b76c3bb44559bd8cd473b1b8de5ff by Hai Shi in branch 'master':
bpo-42599: Remove useless PyModule_GetWarningsModule() (GH-23691)
https://github.com/python/cpython/commit/0f91f586ae9b76c3bb44559bd8cd473b1b8de5ff
msg382741 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-12-08 14:46
> When was the visibility changed to hidden?

In Python 3.9:

commit 0b60f64e4343913b4931dc27379d9808e5b78fe1
Author: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Date:   Tue Oct 15 08:26:12 2019 +0100

    bpo-11410: Standardize and use symbol visibility attributes across POSIX and Windows. (GH-16347)


Symbols which are not declared with PyAPI_FUNC() are no longer exported when using GCC or clang (any compiler supporting -fvisibility=hidden).


PyModule_GetWarningsModule() was not documented nor exported.

I merged the PR. If it breaks too many packages, we can consider to revert the change. But I expect that there are zero project using it.

Note: PyModule_GetWarningsModule() was not part of PC/python3dll.c neither, hopefully ;-)
History
Date User Action Args
2020-12-08 14:46:53vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg382741

stage: patch review -> resolved
2020-12-08 14:42:45vstinnersetmessages: + msg382740
2020-12-08 12:00:01petr.viktorinsetmessages: + msg382730
2020-12-08 11:36:55shihai1991setmessages: + msg382729
2020-12-08 11:34:45shihai1991setkeywords: + patch
stage: patch review
pull_requests: + pull_request22559
2020-12-08 11:28:20vstinnersetmessages: + msg382728
2020-12-08 11:25:12shihai1991create