[issue15556] os.stat fails for file pending delete on Windows

2013-10-24 Thread Tim Golden
Tim Golden added the comment: Had a to-and-fro on IRC with RDM who highlighted that an inconsistency between os.listdir and os.path.exists (the case here) is, at least, undesirable. As it stands, our os.exists on os.stat mechanism will fail because any attempt to get any kind of handle via

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
New submission from Jeremy Kloth: os.stat fails when called on a file that is pending delete but is still in the directory listing. This in turn causes os.path.exists to return the wrong result. Attached is a test case demonstrating this broken behavior. -- components: Library (Lib),

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com: -- nosy: +brian.curtin, loewis, pitrou, tim.golden -jkloth ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15556 ___

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com: -- nosy: +jkloth ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15556 ___ ___

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: How does it fail? Please paste the precise exception. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15556 ___

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
Jeremy Kloth added the comment: Traceback (most recent call last): File stat-bug.py, line 12, in module print('stat', os.stat(pathname)) PermissionError: [Error 5] Access is denied: '\\Users\\Jeremy\\test.tmp' -- ___ Python tracker

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Martin v . Löwis
Martin v. Löwis added the comment: Why do you think the behavior is broken? It looks right to me - it's not possible to get file information for a file that is scheduled for deletion. ISTM that rather os.path.exists has non-intuitive behavior; it shouldn't infer from the PermissionError that

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Jeremy Kloth
Jeremy Kloth added the comment: Why do you think the behavior is broken? It looks right to me - it's not possible to get file information for a file that is scheduled for deletion. However you can when using MSVCRT's stat() function or even FindFirstFile directly. -- nosy:

[issue15556] os.stat fails for file pending delete on Windows

2012-08-04 Thread Chris Jerdonek
Changes by Chris Jerdonek chris.jerdo...@gmail.com: -- nosy: +cjerdonek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15556 ___ ___