Index: buildbot/buildbot_lib.py |
diff --git a/buildbot/buildbot_lib.py b/buildbot/buildbot_lib.py |
index 2c54d8225651c375df877d60f6492bf8fb6582f4..26aa924914c64c25a3bfc93b30849332e60014e2 100644 |
--- a/buildbot/buildbot_lib.py |
+++ b/buildbot/buildbot_lib.py |
@@ -359,7 +359,8 @@ def RemovePath(path): |
if os.path.isdir(path): |
RemoveDirectory(path) |
else: |
- os.chmod(path, stat.S_IWUSR) |
+ if os.path.isfile(path) and not os.access(path, os.W_OK): |
+ os.chmod(path, stat.S_IWUSR) |
os.remove(path) |