Skip to content

Commit 3c28ed6

Browse files
gpsheadclaude
andcommitted
Remove obsolete XXX comment about non-blocking I/O
The comment suggested rewriting Popen._communicate() to use non-blocking I/O on file objects now that Python 3's io module is used instead of C stdio. This is unnecessary - the current approach using select() to detect ready fds followed by os.read()/os.write() is correct and efficient. The selector already solves "when is data ready?" so non-blocking mode would add complexity with no benefit. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a3e98a7 commit 3c28ed6

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Lib/subprocess.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2655,9 +2655,6 @@ def _communicate(self, input, endtime, orig_timeout):
26552655
ready = selector.select(timeout)
26562656
self._check_timeout(endtime, orig_timeout, stdout, stderr)
26572657

2658-
# XXX Rewrite these to use non-blocking I/O on the file
2659-
# objects; they are no longer using C stdio!
2660-
26612658
for key, events in ready:
26622659
if key.fileobj is self.stdin:
26632660
chunk = input_view[self._input_offset :

0 commit comments

Comments
 (0)