os.scandir problem

Rob Cliffe via Python-list <[email protected]> Mon, 30 Mar 2026 12:31:05 +0100
Newsgroups gmane.comp.python.general
Message-ID <[email protected]>
I am using Python 3.13 and Windows 11.
I have a RAM disk (ImDisk), configured to be the R: drive.
When the RAM disc is empty,
     os.scandir("R:")
raises a FileNotFoundError instead of (as I would have expected) 
returning an empty iterator.
Whereas for an empty directory on a hard drive or memory stick, 
os.scandir() does indeed return an empty iterator.
This does seem to be a defect of os.scandir.
Can it be fixed?

Best wishes
Rob Cliffe
-- 
https://mail.python.org/mailman3//lists/python-list.python.org