Skip to content

Commit 0a55415

Browse files
committed
fix potential hang
Fix gh-118981
1 parent a705c1e commit 0a55415

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/multiprocessing/popen_spawn_posix.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ def _launch(self, process_obj):
5757
self._fds.extend([child_r, child_w])
5858
self.pid = util.spawnv_passfds(spawn.get_executable(),
5959
cmd, self._fds)
60+
os.close(child_r)
61+
child_r = None
62+
os.close(child_w)
63+
child_w = None
6064
self.sentinel = parent_r
6165
with open(parent_w, 'wb', closefd=False) as f:
6266
f.write(fp.getbuffer())

0 commit comments

Comments
 (0)