[Python-Dev] Re: os.scandir bug in Windows?

2020-10-28 Thread Eryk Sun
On 10/28/20, Stephen J. Turnbull wrote: > > Note: you can "fix" directory updates by mounting the filesystem r/o. Mounting the filesystem as readonly is the extreme case. Popular Unix systems support a "noatime" mount option that disables updating file access times, unless one of the other

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-28 Thread Stephen J. Turnbull
Greg Ewing writes: > Also it's kind of weird that just looking at data on the > disk can change something about it. The "something about it" *did* change. The world is a dynamic entity, it does change. What you think is weird is that the metadata change is recorded. Note: you can "fix"

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-26 Thread Gregory P. Smith
On Mon, Oct 26, 2020, 4:06 PM Chris Angelico wrote: > On Tue, Oct 27, 2020 at 10:00 AM Greg Ewing > wrote: > > > > On 27/10/20 8:24 am, Victor Stinner wrote: > > > I would > > > rather want to kill the whole concept of "access" time in operating > > > systems (or just configure the OS to not

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-26 Thread Chris Angelico
On Tue, Oct 27, 2020 at 10:00 AM Greg Ewing wrote: > > On 27/10/20 8:24 am, Victor Stinner wrote: > > I would > > rather want to kill the whole concept of "access" time in operating > > systems (or just configure the OS to not update it anymore). I guess > > that it's really hard to make it

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-26 Thread Greg Ewing
On 27/10/20 8:24 am, Victor Stinner wrote: I would rather want to kill the whole concept of "access" time in operating systems (or just configure the OS to not update it anymore). I guess that it's really hard to make it efficient and accurate at the same time... Also it's kind of weird that

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-26 Thread Eryk Sun
On 10/26/20, Victor Stinner wrote: > Le lun. 19 oct. 2020 à 13:50, Steve Dower a écrit > : >> Feel free to file a bug, but we'll likely only add a vague note to the >> docs about how Windows works here rather than changing anything. > > I agree that this surprising behavior can be documented.

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-26 Thread Victor Stinner
Le lun. 19 oct. 2020 à 13:50, Steve Dower a écrit : > Feel free to file a bug, but we'll likely only add a vague note to the > docs about how Windows works here rather than changing anything. I agree that this surprising behavior can be documented. Attempting to provide accurate access time in

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-23 Thread Random832
On Fri, Oct 23, 2020, at 02:14, Random832 wrote: > What correction, exactly, do you mean? The post I saw with the word > "Correction" on it is the one that *makes* the claim people are taking > issue with. okay, sorry, I see the other correction post now... My issue I guess was the same as

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-23 Thread Random832
On Tue, Oct 20, 2020, at 07:42, Steve Dower wrote: > On 20Oct2020 0520, Rob Cliffe wrote: > > On 19/10/2020 12:42, Steve Dower wrote: > >> On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: > >>> TLDR: In os.scandir directory entries, atime is always a copy of > >>> mtime rather than the actual

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-20 Thread Eryk Sun
On 10/19/20, Greg Ewing wrote: > On 20/10/20 4:52 am, Gregory P. Smith wrote: >> Those of us with a traditional posix filesystem background may raise >> eyeballs at this duplication, seeing a directory as a place that merely >> maps names to inodes > > This is probably a holdover from MS-DOS,

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-20 Thread Steve Dower
On 20Oct2020 0520, Rob Cliffe wrote: On 19/10/2020 12:42, Steve Dower wrote: On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: TLDR: In os.scandir directory entries, atime is always a copy of mtime rather than the actual access time. Correction - os.stat() updates the access time to _now_,

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Rob Cliffe via Python-Dev
On 19/10/2020 12:42, Steve Dower wrote: On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: TLDR: In os.scandir directory entries, atime is always a copy of mtime rather than the actual access time. Correction - os.stat() updates the access time to _now_, while os.scandir() returns the

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Greg Ewing
On 20/10/20 4:52 am, Gregory P. Smith wrote: Those of us with a traditional posix filesystem background may raise eyeballs at this duplication, seeing a directory as a place that merely maps names to inodes This is probably a holdover from MS-DOS, where there was no separate inode-like

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Eryk Sun
On 10/19/20, Steve Dower wrote: > > Resolving the path is the most expensive part, even if the file is not > opened (I've been working with the NTFS team on this area, and we've > been benchmarking/analysing all of it). If you say it's been extensively benchmarked and there's no direct way

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Eryk Sun
On 10/19/20, Steve Dower wrote: > On 19Oct2020 1242, Steve Dower wrote: >> On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: >>> TLDR: In os.scandir directory entries, atime is always a copy of mtime >>> rather than the actual access time. >> >> Correction - os.stat() updates the access time to

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Steve Dower
On 19Oct2020 1846, Eryk Sun wrote: On 10/19/20, Steve Dower wrote: On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: TLDR: In os.scandir directory entries, atime is always a copy of mtime rather than the actual access time. Correction - os.stat() updates the access time to _now_, while

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Eryk Sun
On 10/19/20, Steve Dower wrote: > On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: >> TLDR: In os.scandir directory entries, atime is always a copy of mtime >> rather than the actual access time. > > Correction - os.stat() updates the access time to _now_, while > os.scandir() returns the last

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Steve Dower
On 19Oct2020 1652, Gregory P. Smith wrote: I'm sure this is covered in MSDN.  Linking to that if it has it in a concise explanation would make sense from a note in our docs. Probably unlikely :) I'm pretty sure this started "perfect" and was then wound back to improve performance. But it's

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Mats Wichmann
On 10/19/20 9:52 AM, Gregory P. Smith wrote: > > > On Mon, Oct 19, 2020 at 6:28 AM Ivan Pozdeev via Python-Dev > mailto:python-dev@python.org>> wrote: > > > On 19.10.2020 14:47, Steve Dower wrote: > > On 19Oct2020 1242, Steve Dower wrote: > >> On 15Oct2020 2239, Rob Cliffe via

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Gregory P. Smith
On Mon, Oct 19, 2020 at 6:28 AM Ivan Pozdeev via Python-Dev < python-dev@python.org> wrote: > > On 19.10.2020 14:47, Steve Dower wrote: > > On 19Oct2020 1242, Steve Dower wrote: > >> On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: > >>> TLDR: In os.scandir directory entries, atime is always a

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Random832
On Mon, Oct 19, 2020, at 07:42, Steve Dower wrote: > On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: > > TLDR: In os.scandir directory entries, atime is always a copy of mtime > > rather than the actual access time. > > Correction - os.stat() updates the access time to _now_, while >

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Ivan Pozdeev via Python-Dev
On 19.10.2020 14:47, Steve Dower wrote: On 19Oct2020 1242, Steve Dower wrote: On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: TLDR: In os.scandir directory entries, atime is always a copy of mtime rather than the actual access time. Correction - os.stat() updates the access time to

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Steve Dower
On 19Oct2020 1242, Steve Dower wrote: On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: TLDR: In os.scandir directory entries, atime is always a copy of mtime rather than the actual access time. Correction - os.stat() updates the access time to _now_, while os.scandir() returns the last

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-19 Thread Steve Dower
On 15Oct2020 2239, Rob Cliffe via Python-Dev wrote: TLDR: In os.scandir directory entries, atime is always a copy of mtime rather than the actual access time. Correction - os.stat() updates the access time to _now_, while os.scandir() returns the last access time without updating it. Eryk

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-18 Thread Eric V. Smith
On 10/18/2020 12:25 PM, Rob Cliffe via Python-Dev wrote: How do I do that, please?  I can't see an obvious create option on that web page.  Do I need to log in? Yes, you need to log in before you can open an issue. You might need to create an account first if you don't have one: it's called

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-18 Thread Rob Cliffe via Python-Dev
How do I do that, please?  I can't see an obvious create option on that web page.  Do I need to log in? Thanks Rob Cliffe On 18/10/2020 05:31, Gregory P. Smith wrote: Could you please file this as an issue on bugs.python.org ? Thanks! -Greg On Sat, Oct 17, 2020 at

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-18 Thread Eryk Sun
On 10/15/20, Rob Cliffe via Python-Dev wrote: > > TLDR: In os.scandir directory entries, atime is always a copy of mtime > rather than the actual access time. There are inconsistencies in various scenarios between between the stat info from the directory entry and the stat info from the File

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-18 Thread Tal Einat
Interesting! Indeed, please create an issue and post a link here. >From a quick look at the code, I can't see any obvious bugs here, the info seems to be coming directly from FindNextFileW. This will likely require some more digging. On Sun, Oct 18, 2020 at 7:37 AM Gregory P. Smith wrote: >

[Python-Dev] Re: os.scandir bug in Windows?

2020-10-17 Thread Gregory P. Smith
Could you please file this as an issue on bugs.python.org? Thanks! -Greg On Sat, Oct 17, 2020 at 7:25 PM Rob Cliffe via Python-Dev < python-dev@python.org> wrote: > > TLDR: In os.scandir directory entries, atime is always a copy of mtime > rather than the actual access time. > > Demo program: