On Windows, you can't unlink open directories, so this change closes them before calling the rmtree. It shouldn't affect Linux I believe, but I'm not sure why the simpler form of with_open_dir wasnt also used there (debugging?).
Comments
did:plc:jjiv56ot7d6sgethto3jr3r5
Very good catch! Looks like a stupid oversight on my part.
did:plc:nhyitepp3u4u6fcfboegzcjw
I've got a sketch for first-class temp dir support in Eio that helps to avoid the need for this pattern at all. Will work on that once I figure out some Windows-specific quirks with anonymous files!