Peter Boström <pyt...@pbos.me> added the comment: Wow that's old, yeah that's fair (I wouldn't expect this to be backported to any old releases).
Our current "workaround" is to try os.remove, sleep, repeat X times. This seems still racy and not something we'd like to have in our script if it can be resolved upstream. Retried on 2.7.15rc1: C:\src>del *.log Could Not Find C:\src\*.log C:\src>C:\Python2.7.15rc1\python.exe --version Python 2.7.15rc1 C:\src>C:\Python2.7.15rc1\python.exe racy_windows.py Logging to 5656.log Logging to 13068.log Logging to 27620.log Logging to 18384.log Removing 5656.log ERxception in thread Thread-1: Traceback (most recent call last): File "C:\Python2.7.15rc1\lib\threading.py", line 801, in __bootstrap_inner self.run() File "C:\Python2.7.15rc1\lib\threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "racy_windows.py", line 19, in __call__ os.remove(file_name) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '5656.log' emoving 13068.log R emoving 27620.log Exception in thread Thread-3: Traceback (most recent call last): File "C:\Python2.7.15rc1\lib\threading.py", line 801, in __bootstrap_inner self.run() File "C:\Python2.7.15rc1\lib\threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "racy_windows.py", line 19, in __call__ os.remove(file_name) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '27620.log' Exception in thread Thread-2: Traceback (most recent call last): File "C:\Python2.7.15rc1\lib\threading.py", line 801, in __bootstrap_inner self.run() File "C:\Python2.7.15rc1\lib\threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "racy_windows.py", line 19, in __call__ os.remove(file_name) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: '13068.log' Removing 18384.log ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33369> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com