This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, paul.moore, r.david.murray, raylu, serhiy.storchaka, steve.dower, terry.reedy, tim.golden, zach.ware
Date 2017-06-18.23:57:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1497830233.42.0.463733110485.issue29366@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, I think this issue should be closed. But for the record I'd like to note a not uncommon case in which listdir() raise FileNotFoundError on Windows.

According to MS-FSA [1], if a request to open a directory resolves to a file, the operation should fail with STATUS_NOT_A_DIRECTORY (see 2.1.5.1, phase 7). That's the scenario I was discussing in previous messages. However, I neglected to discuss what happens when an intermediate path component is not a directory. In theory this case should also fail with STATUS_NOT_A_DIRECTORY (see 2.1.5.1, phase 6). However, in practice MS file systems instead return STATUS_OBJECT_PATH_NOT_FOUND, which becomes ERROR_PATH_NOT_FOUND, for which Python raises FileNotFoundError.

Walking the path to find the reason for the failure shouldn't be attempted because it's subject to race conditions -- e.g. the file that caused the failure may no longer exist. 

[1]: https://msdn.microsoft.com/en-us/library/ff469536.aspx
History
Date User Action Args
2017-06-18 23:57:13eryksunsetrecipients: + eryksun, terry.reedy, paul.moore, tim.golden, r.david.murray, zach.ware, serhiy.storchaka, steve.dower, raylu
2017-06-18 23:57:13eryksunsetmessageid: <1497830233.42.0.463733110485.issue29366@psf.upfronthosting.co.za>
2017-06-18 23:57:13eryksunlinkissue29366 messages
2017-06-18 23:57:13eryksuncreate