This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pbos
Recipients paul.moore, pbos, steve.dower, tim.golden, zach.ware
Date 2018-04-27.16:56:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1524848190.46.0.682650639539.issue33369@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-04-27 16:56:30pbossetrecipients: + pbos, paul.moore, tim.golden, zach.ware, steve.dower
2018-04-27 16:56:30pbossetmessageid: <1524848190.46.0.682650639539.issue33369@psf.upfronthosting.co.za>
2018-04-27 16:56:30pboslinkissue33369 messages
2018-04-27 16:56:30pboscreate