def setup_permissions(path): file_stat = os.stat(path) os.chmod(path, file_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)