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

posixmodule: convert statically allocated types (DirEntryType & ScandirIteratorType) to heap-allocated types #79562

Closed
eduardo-elizondo mannequin opened this issue Dec 3, 2018 · 9 comments
Labels
3.8 only security fixes stdlib Python modules in the Lib dir

Comments

@eduardo-elizondo
Copy link
Mannequin

eduardo-elizondo mannequin commented Dec 3, 2018

BPO 35381
Nosy @vstinner, @encukou, @ericsnowcurrently, @jdemeyer, @miss-islington, @eduardo-elizondo
PRs
  • bpo-35381 Make all posixmodule types heap-allocated #10854
  • bpo-35381 Remove all static state from posixmodule #15892
  • 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 2019-11-06.14:20:44.509>
    created_at = <Date 2018-12-03.06:33:59.295>
    labels = ['3.8', 'library']
    title = 'posixmodule: convert statically allocated types (DirEntryType & ScandirIteratorType) to heap-allocated  types'
    updated_at = <Date 2020-01-20.12:19:25.650>
    user = 'https://github.com/eduardo-elizondo'

    bugs.python.org fields:

    activity = <Date 2020-01-20.12:19:25.650>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-11-06.14:20:44.509>
    closer = 'petr.viktorin'
    components = ['Library (Lib)']
    creation = <Date 2018-12-03.06:33:59.295>
    creator = 'eelizondo'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35381
    keywords = ['patch']
    message_count = 9.0
    messages = ['330906', '339745', '351895', '356043', '356133', '356634', '356700', '357427', '360311']
    nosy_count = 6.0
    nosy_names = ['vstinner', 'petr.viktorin', 'eric.snow', 'jdemeyer', 'miss-islington', 'eelizondo']
    pr_nums = ['10854', '15892']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue35381'
    versions = ['Python 3.8']

    @eduardo-elizondo
    Copy link
    Mannequin Author

    eduardo-elizondo mannequin commented Dec 3, 2018

    After bpo-34784, there are still two more cases of statically allocated types (DirEntryType & ScandirIteratorType). These should also be heap allocated to make posixmodule fully compatible with PEP-384.

    @eduardo-elizondo eduardo-elizondo mannequin added 3.8 only security fixes stdlib Python modules in the Lib dir labels Dec 3, 2018
    @eduardo-elizondo eduardo-elizondo mannequin changed the title Heap-allocated Posixmodule Heap-allocated Posixmodule types Dec 3, 2018
    @eduardo-elizondo eduardo-elizondo mannequin changed the title Heap-allocated Posixmodule types Heap-allocated posixmodule types Dec 3, 2018
    @vstinner vstinner changed the title Heap-allocated posixmodule types posixmodule: convert statically allocated types (DirEntryType & ScandirIteratorType) to heap-allocated types Jan 7, 2019
    @jdemeyer
    Copy link
    Contributor

    jdemeyer commented Apr 9, 2019

    Just curious... how is PEP-384 relevant to modules insides CPython itself? I thought that this only mattered for external packages. Do you expect people to use a 3.7-compiled posixmodule.c on Python 3.8?

    @ericsnowcurrently
    Copy link
    Member

    @jeroen, see Dino's expalantion in https://bugs.python.org/issue38075#msg351627 (relative to the "random" module).

    @miss-islington
    Copy link
    Contributor

    New changeset b396663 by Miss Islington (bot) (Eddie Elizondo) in branch 'master':
    bpo-35381 Remove all static state from posixmodule (GH-15892)
    b396663

    @encukou
    Copy link
    Member

    encukou commented Nov 6, 2019

    The module still uses tp_new directly, so it's not limited to only stable ABI, but that's for another issue.

    Thanks for the contribution!

    @encukou encukou closed this as completed Nov 6, 2019
    @vstinner
    Copy link
    Member

    This change introduced a reference leak: bpo-38803 "test_wait3 and test_wait4 leaked references on x86 Gentoo Refleaks 3.x".

    @eduardo-elizondo
    Copy link
    Mannequin Author

    eduardo-elizondo mannequin commented Nov 15, 2019

    Woops! I'll get to it before the end of the weekend!

    @eduardo-elizondo
    Copy link
    Mannequin Author

    eduardo-elizondo mannequin commented Nov 25, 2019

    PR with fix is out.

    @vstinner
    Copy link
    Member

    This issue introduced a regression: bpo-39395 "The os module should unset() environment variable at exit".

    @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.8 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants