Commit 6834372
committed
Fix Windows ResourceWarning by properly closing process streams
The new stdio cleanup sequence was causing ResourceWarning on Windows CI
about unclosed _ProactorReadPipeTransport objects. This was because we
were terminating processes while their stdout streams were still open.
Changes:
- Close read_stream_writer and write_stream_reader first to signal tasks
- Explicitly close process.stdout before terminating the process
- This ensures Windows ProactorEventLoop properly cleans up pipe transports
The warnings were surfacing in unrelated tests due to garbage collection
timing, but the root cause was incomplete cleanup in stdio_client.1 parent f5a122c commit 6834372
2 files changed
+15
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
193 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
194 | 207 | | |
195 | 208 | | |
196 | 209 | | |
| |||
211 | 224 | | |
212 | 225 | | |
213 | 226 | | |
214 | | - | |
215 | | - | |
216 | 227 | | |
217 | 228 | | |
218 | 229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
| 161 | + | |
163 | 162 | | |
164 | 163 | | |
165 | 164 | | |
| |||
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
213 | | - | |
| 212 | + | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
| |||
0 commit comments