summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrew Leech <andrew.leech@planetinnovation.com.au>2022-09-09 09:48:01 +1000
committerDamien George <damien@micropython.org>2022-09-13 13:00:42 +1000
commit4e0964b59f44b25ebaa5239f9ea4273b804ebe64 (patch)
tree49544e05be338229e5c9a94d609c572c1c1bf5cf /tools
parent582b3e4e7864809e30eac694251600f61db52a3c (diff)
extmod/vfs: Add finaliser to ilistdir to close directory handle.
When iterating over filesystem/folders with os.iterdir(), an open file (directory) handle is used internally. Currently this file handle is only closed once the iterator is completely drained, eg. once all entries have been looped over / converted into list etc. If a program opens an iterdir but does not loop over it, or starts to loop over the iterator but breaks out of the loop, then the handle never gets closed. In this state, when the iter object is cleaned up by the garbage collector this open handle can cause corruption of the filesystem. Fixes issues #6568 and #8506.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ci.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/ci.sh b/tools/ci.sh
index b4cb7dc2e..8f1d729a1 100755
--- a/tools/ci.sh
+++ b/tools/ci.sh
@@ -632,7 +632,7 @@ function ci_unix_qemu_mips_run_tests {
# - (i)listdir does not work, it always returns the empty list (it's an issue with the underlying C call)
# - ffi tests do not work
file ./ports/unix/build-coverage/micropython
- (cd tests && MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py --exclude 'vfs_posix.py' --exclude 'ffi_(callback|float|float2).py')
+ (cd tests && MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py --exclude 'vfs_posix.*\.py' --exclude 'ffi_(callback|float|float2).py')
}
function ci_unix_qemu_arm_setup {
@@ -652,7 +652,7 @@ function ci_unix_qemu_arm_run_tests {
# - (i)listdir does not work, it always returns the empty list (it's an issue with the underlying C call)
export QEMU_LD_PREFIX=/usr/arm-linux-gnueabi
file ./ports/unix/build-coverage/micropython
- (cd tests && MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py --exclude 'vfs_posix.py')
+ (cd tests && MICROPY_MICROPYTHON=../ports/unix/build-coverage/micropython ./run-tests.py --exclude 'vfs_posix.*\.py')
}
########################################################################################