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 vstinner
Recipients abacabadabacaba, benhoyt, serhiy.storchaka, vstinner
Date 2017-03-06.09:21:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I'm wondering is it possible to implement this feature on Windows?

On Windows, scandir() is implemented with FindFirstFile() which takes strings. This function creates a handle which should then be passed to FindNextFile(). There is no similar function taking a directory handle, so it's not possible to implement os.scandir(fd) on Windows.

It seems like the gnulib emulates fdopendir() on Windows, and its documentation contains warnings:
"But the replacement function is not safe to be used in libraries and is not multithread-safe. Also, the replacement does not guarantee that ‘dirfd(fdopendir(n))==n’ (dirfd might fail, or return a different file descriptor than n)."
Date User Action Args
2017-03-06 09:21:26vstinnersetrecipients: + vstinner, benhoyt, abacabadabacaba, serhiy.storchaka
2017-03-06 09:21:26vstinnersetmessageid: <>
2017-03-06 09:21:26vstinnerlinkissue25996 messages
2017-03-06 09:21:25vstinnercreate