Issue #28666: Try to fix removing readonly directories on Windows.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 20 Nov 2016 18:04:54 +0000 (20:04 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 20 Nov 2016 18:04:54 +0000 (20:04 +0200)
Lib/test/support/__init__.py

index 22d8bd63e58656bbf88e530f1ff5ba4efba1ca66..52c908e0284bf008253842401ad06fcaf533ae78 100644 (file)
@@ -364,7 +364,7 @@ if sys.platform.startswith("win"):
                 else:
                     _force_run(path, os.unlink, fullname)
         _waitfor(_rmtree_inner, path, waitall=True)
-        _waitfor(os.rmdir, path)
+        _waitfor(lambda p: _force_run(p, os.rmdir, p), path)
 else:
     _unlink = os.unlink
     _rmdir = os.rmdir