[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 Cre

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

2012-08-04 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- nosy: +cjerdonek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[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: +jeremy.

[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 t

[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 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 Antoine Pitrou
Antoine Pitrou added the comment: How does it fail? Please paste the precise exception. -- ___ Python tracker ___ ___ Python-bugs-list

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

2012-08-04 Thread Jeremy Kloth
Changes by Jeremy Kloth : -- nosy: +jkloth ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

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

2012-08-04 Thread Jeremy Kloth
Changes by Jeremy Kloth : -- nosy: +brian.curtin, loewis, pitrou, tim.golden -jkloth ___ Python tracker ___ ___ Python-bugs-list maili

[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),