Skip to content

posixmodule uses PyOS_setsig to save & restore signal handlers #114727

Open
@encukou

Description

@encukou

posixmodule ignores signals in os_openpty_impl and os_grantpt_impl by wrapping them in two PyOS_setsig calls:

   sig_saved = PyOS_setsig(SIGCHLD, SIG_DFL);
    ...
    PyOS_setsig(SIGCHLD, sig_saved);

This relies on the GIL being held, so it probably needs a dedicated lock in free-threading builds.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions