Skip to content

PyImport_Cleanup is called with builtins_copy == NULL in test_embed #77560

Description

@serhiy-storchaka
BPO 33379
Nosy @brettcannon, @ncoghlan, @ericsnowcurrently, @serhiy-storchaka

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 = None
created_at = <Date 2018-04-28.22:03:00.332>
labels = ['interpreter-core', '3.8', 'type-bug', '3.7']
title = 'PyImport_Cleanup is called with builtins_copy == NULL in test_embed'
updated_at = <Date 2018-04-29.05:56:26.461>
user = 'https://github.com/serhiy-storchaka'

bugs.python.org fields:

activity = <Date 2018-04-29.05:56:26.461>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2018-04-28.22:03:00.332>
creator = 'serhiy.storchaka'
dependencies = []
files = []
hgrepos = []
issue_num = 33379
keywords = []
message_count = 2.0
messages = ['315868', '315881']
nosy_count = 4.0
nosy_names = ['brett.cannon', 'ncoghlan', 'eric.snow', 'serhiy.storchaka']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue33379'
versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

Activity

  1. serhiy-storchaka commented on Apr 28, 2018

    @serhiy-storchaka
    MemberAuthor

    PyImport_Cleanup is called with builtins_copy == NULL in run_embedded_interpreter() in Lib/test/test_embed.py. This error was silenced by calling PyErr_Clear(), but it still looks as error to me. It was exposed by PR 6606.

  2. serhiy-storchaka commented on Apr 29, 2018

    @serhiy-storchaka
    MemberAuthor

    PyImport_Cleanup() is called in Py_EndInterpreter(), but Py_NewInterpreter() doesn't call _PyImport_Init() which initializes builtins_copy.

  3. transferred this issue fromon Apr 10, 2022
  4. iritkatriel commented on Jun 20, 2022

    @iritkatriel
    Member

    PyImport_Cleanup was renamed to finalize_modules in:

    commit dff1ad5 (HEAD, refs/bisect/bad)
    Author: Victor Stinner vstinner@python.org
    Date: Fri Oct 30 18:03:28 2020 +0100

    bpo-42208: Move _PyImport_Cleanup() to pylifecycle.c (GH-23040)
    
    Move _PyImport_Cleanup() to pylifecycle.c, rename it to
    finalize_modules(), split it (200 lines) into many smaller
    sub-functions and cleanup the code.
    
  5. added a commit that references this issue on Jun 25, 2022
  6. added
    3.12only security fixes
    and removed on Jun 25, 2022
  7. added 2 commits that reference this issue on Jun 25, 2022
  8. vstinner commented on Nov 27, 2024

    @vstinner
    Member

    PyImport_Cleanup is called with builtins_copy == NULL in run_embedded_interpreter() in Lib/test/test_embed.py.

    I don't understand this statement. I need more context.

    The code changed a lot since 2018. I close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

3.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions