Skip to content

Commit

Permalink
fix: Correctly remove bk dir when re-signing macOS Python 2.x executa…
Browse files Browse the repository at this point in the history
…ble (#2272)
  • Loading branch information
moreati committed Jan 2, 2022
1 parent 50c5591 commit 856933e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/changelog/bugfix.2271.rst
@@ -0,0 +1,2 @@
Fix ``PermissionError: [Errno 1] Operation not permitted`` when creating a
Python 2.x virtualenv on macOS/arm64 - by ``moreati``
Expand Up @@ -136,7 +136,7 @@ def fix_signature(self):
bak_dir.mkdir(parents=True, exist_ok=True)
subprocess.check_call(["cp", exe, bak_dir])
subprocess.check_call(["mv", bak_dir / exe.name, exe])
bak_dir.unlink()
bak_dir.rmdir()
cmd = ["codesign", "-s", "-", "--preserve-metadata=identifier,entitlements,flags,runtime", "-f", exe]
logging.debug("Changing Signature: %s", cmd)
subprocess.check_call(cmd)
Expand Down

0 comments on commit 856933e

Please sign in to comment.