Skip to content

Instantly share code, notes, and snippets.

@dnorton
Created May 9, 2016 13:56
Show Gist options
  • Save dnorton/9c9f465a9f458ac095c5f0b9cb74ec58 to your computer and use it in GitHub Desktop.
Save dnorton/9c9f465a9f458ac095c5f0b9cb74ec58 to your computer and use it in GitHub Desktop.
import shutil
import os
import stat
def remove_readonly(func, path, excinfo):
os.chmod(path, stat.S_IWRITE)
func(path)
shutil.rmtree("../../export", onerror=remove_readonly)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment