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 larry
Recipients Arfrever, hynek, larry, serhiy.storchaka
Date 2012-06-28.20:03:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1340913826.46.0.696601959866.issue15217@psf.upfronthosting.co.za>
In-reply-to
Content
I want to mark this as wontfix.

>>> os.listdir in os.supports_fd
True

The concept we're struggling with here: is the "fd" you pass in to os.listdir a "dir_fd"?  I claim that it isn't.  I'm trying to enforce the concept, in both the documentation and the code, that "dir_fd" is a directory fd *accompanying a path*.  With listdir, it isn't accompanied by a path, it replaces the path.  So I suggest it's not a "dir_fd", it's just an "fd" which by sheer coincidence happens to reference a directory.

I proposed making os.listdir accept dir_fd, and internally use open and listdir to emulate the behavior.  But someone (Antoine?) rightly pointed out, this would break the guideline that POSIX os.* functions on Unix-y OSes are atomic.

I might go so far as to say this needs a documentation fix.  But I won't condone any sort of code fix (like adding os.listdir to os.supports_dir_fd).
History
Date User Action Args
2012-06-28 20:03:46larrysetrecipients: + larry, Arfrever, hynek, serhiy.storchaka
2012-06-28 20:03:46larrysetmessageid: <1340913826.46.0.696601959866.issue15217@psf.upfronthosting.co.za>
2012-06-28 20:03:45larrylinkissue15217 messages
2012-06-28 20:03:45larrycreate