Fix directory filtering to not skip entries
Directory filtering code in fs.py was accidentally skipping the entry immediately following a filtered entry; modifying the iterable during iteration has unwanted effects.
Closes: #1056291
Directory filtering code in fs.py was accidentally skipping the entry immediately following a filtered entry; modifying the iterable during iteration has unwanted effects.
Closes: #1056291