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 — recent `-X` options do not auto-propagate to multiprocessing processes · Issue #146004 · python/cpython

recent -X options do not auto-propagate to multiprocessing processes #146004

New issue
Copy link
New issue
Copy link
Closed
Closed
recent -X options do not auto-propagate to multiprocessing processes#146004
Copy link
Assignees
gpsheadpablogsal
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@gpshead
gpshead
opened on Mar 15, 2026
Issue body actions

Bug report

Bug description:

-X lazy_imports, -X thread_inherit_context, and -X context_aware_warnings are not inherited via subprocess._args_from_interpreter_flags() so multiprocessing spawned child processes do not inherit these -X settings unless the user happens to be using the dangerous non-default "fork" start method.

We should consider this for every -X option added. In general the answer should be "yes". There's a list in Lib/subprocess.py to update. (could we automate this by making the list an opt-out instead of a remember-when-adding-a-feature-to-opt-in list?)

Linked PRs

  • gh-146004: propagate all -X options to multiprocessing child processes #146005
  • [3.14] gh-146004: propagate all -X options to multiprocessing child processes (GH-146005) #146552
  • gh-146004: fix test_args_from_interpreter_flags #146580
  • [3.14] gh-146004: fix test_args_from_interpreter_flags on windows (GH-146580) #146585
  • [3.13] gh-146004: propagate all -X options to multiprocessing child processes (GH-146005) #155938
  • [3.13] gh-146004: fix test_args_from_interpreter_flags on windows (GH-146580) #155965

Activity

  1. gpshead
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.15bugs and security fixesbugs and security fixes
    on Mar 15, 2026
  2. picnixz
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    topic-multiprocessing
    on Mar 16, 2026
  3. gpshead
    self-assigned this
    on Mar 16, 2026
  4. gpshead commented on Mar 16, 2026

    @gpshead
    gpshead
    on Mar 16, 2026
    MemberAuthor
    More actions

    Potentially security relevant for -X disable-remote-debug. though i expect people who really want that off build a python without it or at least use the PYTHON_DISABLE_REMOTE_DEBUG= env var.

  5. gpshead
    added a commit that references this issue on Mar 16, 2026

    pythongh-146004: propagate all -X options to subprocesses

    6a115f0
  6. gpshead commented on Mar 16, 2026

    @gpshead
    gpshead
    on Mar 16, 2026
    MemberAuthor
    More actions

    -X options that are not yet being propagated to multiprocessing spawned children that the PR would change:

    ``context_aware_warnings``,
    ``cpu_count``,
    ``disable-remote-debug``,
    ``int_max_str_digits``,
    ``lazy_imports``,
    ``no_debug_ranges``,
    ``pathconfig_warnings``,
    ``perf``,
    ``perf_jit``,
    ``presite``,
    ``pycache_prefix``,
    ``thread_inherit_context``,
    ``warn_default_encoding``.

    thoughts on if any of those should not auto-propagate to non-fork'ed children?

  7. gpshead
    assigned
    pablogsal
    on Mar 16, 2026
  8. gpshead commented on Mar 16, 2026

    @gpshead
    gpshead
    on Mar 16, 2026
    MemberAuthor
    More actions

    And among those, which ones we should specifically backport propagation as a bugfix?

  9. gpshead
    added
    3.14bugs and security fixesbugs and security fixes
    3.13only security fixesonly security fixes
    on Mar 16, 2026
  10. vstinner commented on Mar 27, 2026

    @vstinner
    vstinner
    on Mar 27, 2026
    Member
    More actions

    thoughts on if any of those should not auto-propagate to non-fork'ed children?

    IMO it's safe to propagate all of them to child processes.

    And among those, which ones we should specifically backport propagation as a bugfix?

    I'm fine with backporting your change which propagate the whole sys._xoptions directory.

    Reacted by Gregory P. Smith
  11. gpshead
    added a commit that references this issue on Mar 28, 2026

    gh-146004: propagate all -X options to multiprocessing child processes (

    1efe441
  12. miss-islington
    added a commit that references this issue on Mar 28, 2026

    pythongh-146004: propagate all -X options to multiprocessing child pr…

    6919ddd
  13. gpshead commented on Mar 28, 2026

    @gpshead
    gpshead
    on Mar 28, 2026
    MemberAuthor
    More actions

    status: awaiting a manual backport to 3.13.

  14. gpshead
    added a commit that references this issue on Mar 28, 2026

    [3.14] gh-146004: propagate all -X options to multiprocessing child p…

    28d3b9b
  15. kumaraditya303
    added a commit that references this issue on Mar 29, 2026

    gh-146004: fix test_args_from_interpreter_flags on windows (#146580)

    1af025d
  16. miss-islington
    added a commit that references this issue on Mar 29, 2026

    pythongh-146004: fix test_args_from_interpreter_flags on windows (pyt…

    3ab87af
  17. kumaraditya303
    added a commit that references this issue on Mar 29, 2026

    [3.14] gh-146004: fix test_args_from_interpreter_flags on windows (GH…

    525f8e4
  18. picnixz
    closed this as completedon Mar 29, 2026
  19. maurycy
    added a commit that references this issue on Mar 30, 2026

    Merge remote-tracking branch 'upstream/main' into tachyon-ndjson-kole…

    6a0ea81
  20. clin1234
    added 2 commits that reference this issue on Apr 16, 2026

    pythongh-146004: propagate all -X options to multiprocessing child pr…

    de6eb70

    pythongh-146004: fix test_args_from_interpreter_flags on windows (pyt…

    080801e
  21. ljfp
    added 2 commits that reference this issue on Apr 25, 2026

    pythongh-146004: propagate all -X options to multiprocessing child pr…

    a1131cb

    pythongh-146004: fix test_args_from_interpreter_flags on windows (pyt…

    56ca205
  22. hanlee55
    added 2 commits that reference this issue on Aug 17, 2026

    pythongh-146004: propagate all -X options to multiprocessing child pr…

    1a93745

    pythongh-146004: fix test_args_from_interpreter_flags on windows (pyt…

    197a74a
  23. hugovk
    added a commit that references this issue on Aug 17, 2026

    [3.13] gh-146004: propagate all -X options to multiprocessing child p…

    d3f5290
  24. zware
    added a commit that references this issue on Aug 18, 2026

    [3.13] gh-146004: fix test_args_from_interpreter_flags on windows (GH…

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

Metadata

Metadata

Assignees

  • @gpshead
    gpshead
  • @pablogsal
    pablogsal

Labels

3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

No projects

    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.