test_logging is failing on some buildbots: test_logging::AMD64 Windows7 SP1 3.x a0b750 42970c 9aafc0 test_logging::x86 Windows Server 2003 [SB] 3.x 9aafc0 6b69c1 c261b7 test_logging::x86 XP-4 3.x 6b69c1 c261b7 test_logging::x86 XP-5 3.x c261b7 7e8184 Only the Windows buildbots on 3.x seems to be affected. The failing tests were introduced in #11557. See e.g.: http://buildbot.python.org/builders/x86%20XP-5%203.x/builds/1946/steps/test/logs/stdio ====================================================================== ERROR: test_filemode (test.test_logging.BasicConfigTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\Buildslave\3.x.moore-windows\build\lib\unittest\case.py", line 385, in _executeTestPart function() File "D:\Buildslave\3.x.moore-windows\build\lib\unittest\case.py", line 484, in part = lambda: function(*args, **kwargs) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'test.log' ====================================================================== ERROR: test_filename (test.test_logging.BasicConfigTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "D:\Buildslave\3.x.moore-windows\build\lib\unittest\case.py", line 385, in _executeTestPart function() File "D:\Buildslave\3.x.moore-windows\build\lib\unittest\case.py", line 484, in part = lambda: function(*args, **kwargs) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'test.log' ---------------------------------------------------------------------- Ran 145 tests in 7.234s FAILED (errors=2, skipped=2)
I'm not sure it's related to #11557 - it's more likely to be my changes last week to fix #17313, where I changed those tests to add self.addCleanup(os.remove, 'test.log') There's also an addCleanup that closes the handler which opens the file, which should close the file, but it may be that the cleanup functions get executed out of order. I'll consolidate both operations into a single cleanup function.