gh-157579: Fix race condition in the cleanup of tempfile.TemporaryDirectory - #157580
StanFromIreland wants to merge 19 commits into
Conversation
This reduces the attack surface -- readable files avoid the race condition.
Co-authored-by: Stan Ulbrych <stan@python.org>
Documentation build overview
6 files changed ·
|
|
I'm not sure why Emscripten failed in this run on The test swaps a directory for a symlink to the outside directory mid-recovery, however the |
|
Will take a look. |
|
Meanwhile let's start buildbots for all the other architectures/configurations |
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit a837624 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157580%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
And it seems all the buildbots older with masOS <26 (and iOS) are failing on We don't know if the test passes or not, as we don't reach the final assertions. I'm also not quite sure why this happens, and I don't have access to a machine to debug. It's possible that the hook's |
Funny storyI can reproduce! .... on an ancient Intel MacBook that bought it in this state to take macOS screenshots for tutorials. It lasts ~10 min on battery and has a broken screen. It also has only has 1 USB port, so I can charge it, or connect a monitor/LAN, but not both at once. (This was never a problem for screenshots...) So, work is slow. But, in the end, after several tries, I did manage to find a compatible dongle. Turns out that on old macOS, you can't rename a directory if you don't have write permissions on that directory. (On Linux and -- apparently -- new macs, you need write on the containing directory; that has the inode you're manipulating.) The rmtree will:
Back in the test, in the
|
Co-authored-by: Petr Viktorin <encukou@gmail.com>
This reverts commit 4baeeb1.
😆 Oh no, sorry for the trouble, but thank you!
Aargh, that's interesting. I applied your suggestion, but I think it's better to make it writeable in the hook instead so that we rename properly. |
|
!buildbot macOS|iOS |
|
🤖 New build scheduled with the buildbot fleet by @StanFromIreland for commit de46e06 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F157580%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
tempfile.TemporaryDirectory#157579