]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-109709: Fix asyncio test_stdin_broken_pipe() (GH-109710) (#109731)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Oct 2023 15:21:51 +0000 (08:21 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Oct 2023 15:21:51 +0000 (17:21 +0200)
commitc7cbd82e62d22b6b1c6d4e95dbbd1db16c321533
treef10dd18dfab132664abdfae15060f5a51b2c476f
parent551aa6ab9419109a80ad53900ad930e9b7f2e40d
[3.12] gh-109709: Fix asyncio test_stdin_broken_pipe() (GH-109710) (#109731)

gh-109709: Fix asyncio test_stdin_broken_pipe() (GH-109710)

Replace harcoded sleep of 500 ms with synchronization using a pipe.

Fix also Process._feed_stdin(): catch also BrokenPipeError on
stdin.write(input), not only on stdin.drain().
(cherry picked from commit cbbdf2c1440c804adcfc32ea0470865b3b3b8eb2)

Co-authored-by: Victor Stinner <vstinner@python.org>
Lib/asyncio/subprocess.py
Lib/test/test_asyncio/test_subprocess.py