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

Support the macOS-only POSIX_SPAWN_CLOEXEC_DEFAULT flag and posix_spawn_file_actions_addinherit_np() in os.posix_spawn #109154

Open
Assignees
gpsheadronaldoussoren
Labels
3.13bugs and security fixesOS-mactype-featureA feature request or enhancement
@mrpippy

Description

@mrpippy

Feature or enhancement

Proposal:

macOS supports a non-standardposix_spawn() flag,POSIX_SPAWN_CLOEXEC_DEFAULT, which makes "only file descriptors explicitly created by the file_actions argument available in the spawned process; all of the other file descriptors are automatically closed in the spawned process."

This would be useful forsubprocess, whereclose_fds defaulting to True means thatposix_spawn() is not used by default.POSIX_SPAWN_CLOEXEC_DEFAULT combined with (the also non-standard)posix_spawn_file_actions_addinherit_np() would provide a correct way to useposix_spawn() whenclose_fds=True.

AChromium bug indicates thatPOSIX_SPAWN_CLOEXEC_DEFAULT was added in OS X 10.7 but causes kernel panics there, for safety this should probably only be used on OS X 10.8 and later.

This could be added as acloexec_default=False argument toos.posix_spawn() andos.posix_spawnp().

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

#79718 was the original issue for usingos.posix_spawn() insubprocess.
#86904 proposed changingclose_fds to default to False, soposix_spawn() could be used more often

Metadata

Metadata

Labels

3.13bugs and security fixesOS-mactype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp