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 SilentGhost, benhoyt, db3l, eryksun, ideasman42, mont29, paul.moore, python-dev, serhiy.storchaka, steve.dower, tim.golden, vstinner, zach.ware
Date 2016-03-29.11:58:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1459252724.78.0.806143062009.issue25911@psf.upfronthosting.co.za>
In-reply-to
Content
> BTW, with respect to changeset 2b25fa7e3b7a, I'm not sure it has quite the right semantics for is_dir, at least not if it's supposed to parallel os.path.isdir().  I believe that should return True for a symbolic link to a directory, which it doesn't look like this change would, if is_symlink happened to have been called first.  It's possible the semantics of how _DummyDirEntry is used precludes that scenario, but it seems a little fragile.  I'd probably just use lstat() for is_symlink, but otherwise not touch is_dir.

I think that you misunderstood the code. The "use cache lstat" path is only taken if the file is *not* symbolic link.

I tested manually _DummyDirEntry on a symbolic link to a directory: _lstat is filled by the constructor, is_dir() *and* is_symlink() returns True. Both are not exclusive, is_dir() works as follow_symlinks=True, whereas is_symlink() works as follow_symlinks=False.
History
Date User Action Args
2016-03-29 11:58:44vstinnersetrecipients: + vstinner, paul.moore, db3l, tim.golden, ideasman42, SilentGhost, benhoyt, python-dev, zach.ware, serhiy.storchaka, eryksun, steve.dower, mont29
2016-03-29 11:58:44vstinnersetmessageid: <1459252724.78.0.806143062009.issue25911@psf.upfronthosting.co.za>
2016-03-29 11:58:44vstinnerlinkissue25911 messages
2016-03-29 11:58:44vstinnercreate