+# From pathutils by Michael Foord: http://www.voidspace.org.uk/python/pathutils.html
+def onerror(func, path, exc_info):
+ Error handler for ``shutil.rmtree``.
+ If the error is due to an access error (read only file)
+ it attempts to add write permission and then retries.
+ If the error is for another reason it re-raises the error.
+ Usage : ``shutil.rmtree(path, onerror=onerror)``
+ if not os.access(path, os.W_OK):
+ # Is the error an access error ?
+ os.chmod(path, stat.S_IWUSR)
__all__ = ['TestFileEnvironment']
print >> sys.stderr, 'Please delete this directory manually'
"The directory %s was not created by ScriptTest; it must be deleted manually" % self.base_path)
f = open(marker_file, 'w')