There's the script to re-create folder:
# Remove folder (if exists) with all files
if os.path.isdir(str(os.path.realpath('..') + "\\my_folder")):
shutil.rmtree(os.path.realpath('..') + "\\my_folder", ignore_errors=True)
# Create new folder
os.mkdir(os.path.realpath('..') + "\\my_folder")
This works nearly always, but in some cases (on creation step) I get
WindowsError: [Error 5] Access is denied: 'C:\\Path\\To\\my_folder'
What could cause this error and how can I avoid it?