Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Multiprocessing not propagating -Xfrozen_modules=off #106723

Closed
Assignees
gpshead
Labels
3.11only security fixes3.12only security fixestopic-multiprocessingtype-bugAn unexpected behavior, bug, or error
@ergoithz

Description

@ergoithz

Bug report

After python3.11 changes around frozen imports, when using multiprocessing contexts other thanfork, the newly added-Xfrozen_modules=off isn't passed to spawned process interpreters.

Simple snippet demonstrating the issue:

"""$ python -Xfrozen_modules=off test.pymain: {'frozen_modules': 'off'}forkserver: {}spawn: {}fork: {'frozen_modules': 'off'}"""importsysimportmultiprocessingdefxoptions():returnsys._xoptionsdefmain():print('main:',xoptions())forctxin ('forkserver','spawn','fork'):withmultiprocessing.get_context(ctx).Pool(1)aspool:print(f'{ctx}:',pool.apply(xoptions))if__name__=='__main__':main()

The issue seems to besubprocess._args_from_interpreter_flags not honoringfrozen_modules key fromsys._xoptions.

$ python -Xfrozen_modules=off -c'import subprocess;print(subprocess._args_from_interpreter_flags())'[]

Your environment

python 3.11.4

Linked PRs

Metadata

Metadata

Assignees

Labels

3.11only security fixes3.12only security fixestopic-multiprocessingtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp