From 39723424ece85b0a143f9053fa142ad0d4c4e85c Mon Sep 17 00:00:00 2001 From: Kadir Can Ozden <101993364+bysiber@users.noreply.github.com> Date: Fri, 20 Feb 2026 09:26:31 +0300 Subject: [PATCH] Fix error message: says stdout but checks stdin The ValueError raised when stdin=subprocess.PIPE is used without nursery.start incorrectly says 'stdout=subprocess.PIPE'. This is confusing for users since the actual problem is with the stdin argument, not stdout. --- src/trio/_subprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/trio/_subprocess.py b/src/trio/_subprocess.py index 145c2de9b..d73ba3dc2 100644 --- a/src/trio/_subprocess.py +++ b/src/trio/_subprocess.py @@ -675,7 +675,7 @@ async def my_deliver_cancel(process): if task_status is trio.TASK_STATUS_IGNORED: if stdin is subprocess.PIPE: raise ValueError( - "stdout=subprocess.PIPE is only valid with nursery.start, " + "stdin=subprocess.PIPE is only valid with nursery.start, " "since that's the only way to access the pipe; use nursery.start " "or pass the data you want to write directly", )