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

Allow PYTHONTRACEMALLOC=0 and -X tracemalloc=0 to disable explicitly tracemalloc #78409

vstinner opened this issue Jul 25, 2018 · 3 comments
3.8 only security fixes stdlib Python modules in the Lib dir


Copy link

BPO 34228
Nosy @vstinner
  • bpo-34228: Allow PYTHONTRACEMALLOC=0 #8467
  • 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 2018-07-26.08:53:13.330>
    created_at = <Date 2018-07-25.16:54:55.120>
    labels = ['3.8', 'library']
    title = 'Allow PYTHONTRACEMALLOC=0 and -X tracemalloc=0 to disable explicitly tracemalloc'
    updated_at = <Date 2018-07-26.08:53:13.329>
    user = '' fields:

    activity = <Date 2018-07-26.08:53:13.329>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-07-26.08:53:13.330>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2018-07-25.16:54:55.120>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34228
    keywords = ['patch']
    message_count = 3.0
    messages = ['322369', '322372', '322407']
    nosy_count = 1.0
    nosy_names = ['vstinner']
    pr_nums = ['8467']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = ''
    versions = ['Python 3.8']

    Copy link
    Member Author

    Currently, -X tracemalloc=0 command line option is reject as an invalid value. I would like to allow to explicitly disable tracemalloc. That's useful to ignore the PYTHONTRACEMALLOC environment variable:

    "PYTHONTRACEMALLOC=1 python3 -X tracemalloc=0" would not enable tracemalloc at startup.

    @vstinner vstinner added 3.8 only security fixes stdlib Python modules in the Lib dir labels Jul 25, 2018
    Copy link
    Member Author

    New changeset 60b04c9 by Victor Stinner in branch 'master':
    bpo-34228: Allow PYTHONTRACEMALLOC=0 (GH-8467)

    Copy link
    Member Author

    I don't think that it's worth it to backport this change. It's really a corner case and it's almsot a bugfix. I mostly need it for testing _PyCoreConfig and Python initialisation.

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

    No branches or pull requests

    1 participant