Antoine Pitrou added the comment: > IIUC, the sequence of events is this: > 1. touch > 2. read old_mtime > 3. date back 10s > 4. touch > 5. read mtime > > So the time stamp that is set in step 3 is never read, correct? So > there is no test that it is newer than the 10s-old-stamp, but only > newer then the recent-stamp (step 2)?
Indeed, the test is that step 4 overrides the timestamp set in step 3 with something that represents "now"; and the heuristic for that is that the mtime in step 5 is at least as fresh as the mtime in step 2 (the old_mtime). So step 3 serves to make sure that the test isn't being fooled by a coarse timestamp granularity. Another way of doing the same thing (but more costly) would be to call time.sleep(several seconds). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19715> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com