diff --git a/launcher.py b/launcher.py index 56668da57..23c5e48ec 100644 --- a/launcher.py +++ b/launcher.py @@ -65,6 +65,7 @@ def parse_cli_arguments(): def install_reqs(audio): + remove_reqs_readonly() interpreter = sys.executable if interpreter is None: @@ -116,6 +117,7 @@ def update_pip(): def update_red(): + remove_reqs_readonly() try: code = subprocess.call(("git", "pull", "--ff-only")) except FileNotFoundError: @@ -421,6 +423,18 @@ def remove_readonly(func, path, excinfo): func(path) +def remove_reqs_readonly(): + """Workaround for issue #569""" + if not os.path.isdir(REQS_DIR): + return + os.chmod(REQS_DIR, stat.S_IWRITE) + for root, dirs, files in os.walk(REQS_DIR): + for d in dirs: + os.chmod(os.path.join(root, d), stat.S_IWRITE) + for f in files: + os.chmod(os.path.join(root, f), stat.S_IWRITE) + + def calculate_md5(filename): hash_md5 = hashlib.md5() with open(filename, "rb") as f: