GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Re-Loading the sys or builtins Modules is Problematic · Issue #102660 · python/cpython

Re-Loading the sys or builtins Modules is Problematic #102660

New issue
Copy link
New issue
Copy link
Open
Open
Re-Loading the sys or builtins Modules is Problematic#102660
Copy link
Labels
3.12only security fixesonly security fixes3.13only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-featureA feature request or enhancementA feature request or enhancement

Description

@ericsnowcurrently
ericsnowcurrently
opened on Mar 13, 2023
Issue body actions

The sys and builtins modules are special in that they are initialized early in interpreter startup, mostly before the import system. They aren't initialized like other modules. Furthermore, the data they expose is fundamental to the interpreter. Reloading the modules doesn't make much sense.

The simplest thing to do is to disallow manually loading them (e.g. via the loader). At the very least we should handle m_copy for these modules carefully. (This came up while working on gh-101660.)

Linked PRs

  • gh-102660: Handle m_copy Specially for the sys and builtins Modules #102661
  • gh-102660: Fix Refleaks in import.c #102744
  • gh-102660: Fix is_core_module() #103257

Activity

  1. ericsnowcurrently
    added
    type-featureA feature request or enhancementA feature request or enhancement
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    topic-subinterpreters
    3.12only security fixesonly security fixes
    on Mar 13, 2023
  2. ericsnowcurrently
    self-assigned this
    on Mar 13, 2023
  3. ezio-melotti
    added this to Subinterpreterson Mar 13, 2023
  4. ericsnowcurrently
    added a commit that references this issue on Mar 14, 2023

    gh-102660: Handle m_copy Specially for the sys and builtins Modules (g…

    cdb21ba
  5. ericsnowcurrently commented on Mar 14, 2023

    @ericsnowcurrently
    ericsnowcurrently
    on Mar 14, 2023
    MemberAuthor
    More actions

    I'm leaving this open since we haven't settled whether or not we should disallow directly loading sys/builtins. (That isn't critical to settle in the short-term, so I'm not going to focus much on it for now.)

  6. ericsnowcurrently
    removed their assignment
    on Mar 14, 2023
  7. carljm
    added a commit that references this issue on Mar 14, 2023

    Merge branch 'main' into inlinecomp2

    6c5f269
  8. ericsnowcurrently
    added a commit that references this issue on Mar 16, 2023

    gh-102660: Fix Refleaks in import.c (#102744)

    2a03ed0
  9. carljm
    added a commit that references this issue on Mar 17, 2023

    Merge branch 'main' into inlinecomp2

    1a8f4a0
  10. Fidget-Spinner
    added 2 commits that reference this issue on Mar 27, 2023

    pythongh-102660: Handle m_copy Specially for the sys and builtins Mod…

    f4367d5

    pythongh-102660: Fix Refleaks in import.c (python#102744)

    9368557
  11. ericsnowcurrently
    added a commit that references this issue on Apr 4, 2023

    gh-102660: Fix is_core_module() (gh-103257)

    f513d5c
  12. gaogaotiantian
    added a commit that references this issue on Apr 8, 2023

    pythongh-102660: Fix is_core_module() (pythongh-103257)

    f7e15af
  13. warsaw
    added 3 commits that reference this issue on Apr 11, 2023

    pythongh-102660: Handle m_copy Specially for the sys and builtins Mod…

    d2aeb2a

    pythongh-102660: Fix Refleaks in import.c (python#102744)

    bdc60ae

    pythongh-102660: Fix is_core_module() (pythongh-103257)

    2380473
  14. erlend-aasland
    added
    3.13only security fixesonly security fixes
    on Jan 5, 2024
  15. ericsnowcurrently
    moved this to Todo in Subinterpreterson Feb 26, 2024
  16. hugovk commented on Mar 15, 2024

    @hugovk
    hugovk
    on Mar 15, 2024
    Member
    More actions

    Triage: can this be closed or is there more to do?

    Edit: I see this was recently move to "Todo" so sounds like there is more. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixesonly security fixes3.13only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)topic-subinterpreterstype-featureA feature request or enhancementA feature request or enhancement

    Projects

    • Subinterpreters
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.