|
7 | 7 | from abc import ABCMeta, abstractmethod |
8 | 8 | from textwrap import dedent |
9 | 9 |
|
10 | | -from six import add_metaclass |
| 10 | +from six import add_metaclass, text_type |
11 | 11 |
|
12 | 12 | from virtualenv.create.via_global_ref.builtin.ref import ExePathRefToDest, PathRefToDest, RefMust |
13 | 13 | from virtualenv.info import IS_MAC_ARM64 |
@@ -134,10 +134,11 @@ def fix_signature(self): |
134 | 134 | # Reset the signing on Darwin since the exe has been modified. |
135 | 135 | # Note codesign fails on the original exe, it needs to be copied and moved back. |
136 | 136 | bak_dir.mkdir(parents=True, exist_ok=True) |
137 | | - subprocess.check_call(["cp", exe, bak_dir]) |
138 | | - subprocess.check_call(["mv", bak_dir / exe.name, exe]) |
| 137 | + subprocess.check_call(["cp", text_type(exe), text_type(bak_dir)]) |
| 138 | + subprocess.check_call(["mv", text_type(bak_dir / exe.name), text_type(exe)]) |
139 | 139 | bak_dir.rmdir() |
140 | | - cmd = ["codesign", "-s", "-", "--preserve-metadata=identifier,entitlements,flags,runtime", "-f", exe] |
| 140 | + metadata = "--preserve-metadata=identifier,entitlements,flags,runtime" |
| 141 | + cmd = ["codesign", "-s", "-", metadata, "-f", text_type(exe)] |
141 | 142 | logging.debug("Changing Signature: %s", cmd) |
142 | 143 | subprocess.check_call(cmd) |
143 | 144 | except Exception: |
|
0 commit comments