Repository navigation
recent -X options do not auto-propagate to multiprocessing processes #146004
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error3.15bugs and security fixesbugs and security fixes
on Mar 15, 2026 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Mar 16, 2026 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.- added a commit that references this issue
on Mar 16, 2026 -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?
And among those, which ones we should specifically backport propagation as a bugfix?
- added3.14bugs and security fixesbugs and security fixes3.13only security fixesonly security fixes
on Mar 16, 2026 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._xoptionsdirectory.Reacted by Gregory P. Smith- added a commit that references this issue
on Mar 28, 2026 status: awaiting a manual backport to 3.13.
- added a commit that references this issue
on Mar 28, 2026 - added a commit that references this issue
on Mar 29, 2026 - added a commit that references this issue
on Mar 30, 2026 - added a commit that references this issue
on Aug 17, 2026 - added a commit that references this issue
on Aug 18, 2026
Bug report
Bug description:
-X lazy_imports,-X thread_inherit_context, and-X context_aware_warningsare not inherited viasubprocess._args_from_interpreter_flags()somultiprocessingspawned child processes do not inherit these-Xsettings 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.pyto 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