From 67145da961ccdd649d970c270a559943485ecd53 Mon Sep 17 00:00:00 2001 From: Prithviraj Chaudhuri Date: Fri, 26 Dec 2025 19:03:43 -0500 Subject: [PATCH 1/5] Changed condition to evaluate if timeout is less than or equals to 0 --- Lib/subprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 17333d8c02255d..3cebd7883fcf29 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -2140,7 +2140,7 @@ def _communicate(self, input, endtime, orig_timeout): while selector.get_map(): timeout = self._remaining_time(endtime) - if timeout is not None and timeout < 0: + if timeout is not None and timeout <= 0: self._check_timeout(endtime, orig_timeout, stdout, stderr, skip_check_and_raise=True) From d2f22e9768536d87c1ae3a10392c33e4f6d748e6 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 27 Dec 2025 00:14:58 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst diff --git a/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst b/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst new file mode 100644 index 00000000000000..636259f541a659 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst @@ -0,0 +1 @@ +Changed condition in Lib/subprocess.py _communicate to call _check_timeout when 'timeout <= 0' From 800debda3910ff59b1c16015e2145d3073039851 Mon Sep 17 00:00:00 2001 From: Prithviraj Chaudhuri Date: Sun, 28 Dec 2025 10:53:31 -0500 Subject: [PATCH 3/5] Updated blurb to be more descriptive --- .../next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst b/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst index 636259f541a659..98206a42c74131 100644 --- a/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst +++ b/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst @@ -1 +1 @@ -Changed condition in Lib/subprocess.py _communicate to call _check_timeout when 'timeout <= 0' +Update timeout evaluation logic to be compatible with deterministic environments like Shadow where time moves exactly as requested. From 6fe2ef36bd7fd89969a153fcead2fc0344f9c5e0 Mon Sep 17 00:00:00 2001 From: Prithviraj Chaudhuri Date: Sun, 28 Dec 2025 10:54:09 -0500 Subject: [PATCH 4/5] Fix blurb grammer --- .../next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst b/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst index 98206a42c74131..6cf7b9df1bc04a 100644 --- a/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst +++ b/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst @@ -1 +1 @@ -Update timeout evaluation logic to be compatible with deterministic environments like Shadow where time moves exactly as requested. +Updated timeout evaluation logic to be compatible with deterministic environments like Shadow where time moves exactly as requested. From de3df836219f009beda05ffe2e0ae4ea12e63dbb Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" <68491+gpshead@users.noreply.github.com> Date: Sun, 28 Dec 2025 08:32:41 -0800 Subject: [PATCH 5/5] update news to mention the module name. --- .../next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst b/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst index 6cf7b9df1bc04a..b2b1ffe7225bd7 100644 --- a/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst +++ b/Misc/NEWS.d/next/Library/2025-12-27-00-14-56.gh-issue-142195.UgBEo5.rst @@ -1 +1 @@ -Updated timeout evaluation logic to be compatible with deterministic environments like Shadow where time moves exactly as requested. +Updated timeout evaluation logic in :mod:`subprocess` to be compatible with deterministic environments like Shadow where time moves exactly as requested.