Commit 34e93c0
fix: close pty writer in read_to_end to eliminate race condition
On Linux, writing to a PTY master after the child exits can succeed
(kernel buffers the data), unlike macOS which returns EIO. The
background thread sets writer=None after setting exit_status, but
read_to_end returns right after exit_status is set, creating a window
where write() still succeeds. Close the writer in read_to_end itself.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 251c877 commit 34e93c0
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
197 | 202 | | |
198 | 203 | | |
199 | 204 | | |
| |||
0 commit comments