Skip to content

test: test.py leaks pseudo-tty master fd to child  #28489

Closed
@bnoordhuis

Description

Lest I forget: the master fd created here:

(out_master, fd_out) = pty.openpty()

Is leaked to the spawned child here:

node/tools/test.py

Lines 761 to 772 in 20d099a

(process, exit_code, timed_out, output) = RunProcess(
context,
timeout,
args = args,
stdin = fd_in,
stdout = fd_out,
stderr = fd_err,
env = env_copy,
faketty = faketty,
pty_out = pty_out,
preexec_fn = preexec_fn
)

Fix: the preexec_fn should os.close(pty_out).

Metadata

Assignees

Labels

pythonPRs and issues that require attention from people who are familiar with Python.testIssues and PRs related to the tests.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions