Bug report
Bug description:
I'd expect this snippet to raise a subprocess.CalledProcessError exception, but it just hangs instead:
import subprocess
with subprocess.Popen(["sleep", "infinity"]) as process:
subprocess.run(["false"], check=True)
process.terminate()
The same functionality without the manged context does raise as expected:
import subprocess
process = subprocess.Popen(["sleep", "infinity"])
subprocess.run(["false"], check=True)
process.terminate()
The nested call to subprocess.run() returns as expected, when the called process doesn't fail:
import subprocess
with subprocess.Popen(["sleep", "infinity"]) as process:
subprocess.run(["true"], check=True)
process.terminate()
CPython versions tested on:
3.13.13, 3.14.5, 3.15.0b2
Operating systems tested on:
Linux
Bug report
Bug description:
I'd expect this snippet to raise a
subprocess.CalledProcessErrorexception, but it just hangs instead:The same functionality without the manged context does raise as expected:
The nested call to
subprocess.run()returns as expected, when the called process doesn't fail:CPython versions tested on:
3.13.13, 3.14.5, 3.15.0b2
Operating systems tested on:
Linux