Commit 9ec20a1
committed
π fix(subprocess): drain pipes after killing timed-out process
On Windows, process.kill() terminates the process but doesn't close
inherited pipe handles. The reader threads spawned by communicate()
stay blocked on fh.read() indefinitely, preventing the caller from
ever returning. This was observed in tox CI where the 5s timeout
fired and killed the process, yet the test still hung.
Calling communicate() after kill() joins the reader threads and
closes the pipes, as required by the Python subprocess docs.1 parent 427f817 commit 9ec20a1
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
0 commit comments