Message262606
> 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. |
|
Date |
User |
Action |
Args |
2016-03-29 11:58:44 | vstinner | set | recipients:
+ vstinner, paul.moore, db3l, tim.golden, ideasman42, SilentGhost, benhoyt, python-dev, zach.ware, serhiy.storchaka, eryksun, steve.dower, mont29 |
2016-03-29 11:58:44 | vstinner | set | messageid: <1459252724.78.0.806143062009.issue25911@psf.upfronthosting.co.za> |
2016-03-29 11:58:44 | vstinner | link | issue25911 messages |
2016-03-29 11:58:44 | vstinner | create | |
|