Navigation Menu

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

Remove PyModule_GetWarningsModule() in pylifecycle.c #86765

Closed
shihai1991 opened this issue Dec 8, 2020 · 6 comments
Closed

Remove PyModule_GetWarningsModule() in pylifecycle.c #86765

shihai1991 opened this issue Dec 8, 2020 · 6 comments
Labels
3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@shihai1991
Copy link
Member

BPO 42599
Nosy @vstinner, @encukou, @shihai1991
PRs
  • bpo-42599: Remove PyModule_GetWarningsModule() of pylifecycle.c #23691
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-12-08.14:46:53.031>
    created_at = <Date 2020-12-08.11:25:12.837>
    labels = ['interpreter-core', '3.10']
    title = 'Remove PyModule_GetWarningsModule() in pylifecycle.c'
    updated_at = <Date 2020-12-08.14:46:53.030>
    user = 'https://github.com/shihai1991'

    bugs.python.org fields:

    activity = <Date 2020-12-08.14:46:53.030>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-12-08.14:46:53.031>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2020-12-08.11:25:12.837>
    creator = 'shihai1991'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42599
    keywords = ['patch']
    message_count = 6.0
    messages = ['382727', '382728', '382729', '382730', '382740', '382741']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'petr.viktorin', 'shihai1991']
    pr_nums = ['23691']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue42599'
    versions = ['Python 3.10']

    @shihai1991
    Copy link
    Member Author

    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.

    @shihai1991 shihai1991 added 3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Dec 8, 2020
    @vstinner
    Copy link
    Member

    vstinner commented Dec 8, 2020

    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.

    @shihai1991
    Copy link
    Member Author

    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.

    @encukou
    Copy link
    Member

    encukou commented Dec 8, 2020

    When was the visibility changed to hidden?

    @vstinner
    Copy link
    Member

    vstinner commented Dec 8, 2020

    New changeset 0f91f58 by Hai Shi in branch 'master':
    bpo-42599: Remove useless PyModule_GetWarningsModule() (GH-23691)
    0f91f58

    @vstinner
    Copy link
    Member

    vstinner commented Dec 8, 2020

    When was the visibility changed to hidden?

    In Python 3.9:

    commit 0b60f64
    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 ;-)

    @vstinner vstinner closed this as completed Dec 8, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants