Skip to content

borg2: Popen, preexec_fn and SIGINT (Ctrl-C) (windows) #7196

@ThomasWaldmann

Description

@ThomasWaldmann
subprocess.Popen(args.paths, stdout=subprocess.PIPE, preexec_fn=None if is_win32 else ignore_sigint)

On Linux, the preexec_fn is used to ignore SIGINT in the created subprocess.

This is important so that a user pressing Ctrl-C does not kill the subprocesses of borg (like ssh or tar). These must run until they naturally end and the borg main process needs them to shutdown cleanly.

On Windows, there is no preexec_fn, so the shown code line leads to a slightly misbehaved Ctrl-C there.

Is there an alternative way to deal with this on windows?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions