diff --git a/pex/common.py b/pex/common.py index b96020b6a..dcb28fba1 100644 --- a/pex/common.py +++ b/pex/common.py @@ -105,7 +105,6 @@ def do_copy(): os.rename(temp_dest, dest) # If the platform supports hard-linking, use that and fall back to copying. - # Windows does not support hard-linking. if hasattr(os, "link"): try: os.link(source, dest) @@ -127,6 +126,10 @@ def do_copy(): # # See also https://github.com/pex-tool/pex/issues/850 where this was discovered. do_copy() + elif getattr(e, 'winerror', None) == 1142: + # OSError: [WinError 1142] An attempt was made to create more links on a file than + # the file system supports + do_copy() else: raise elif os.path.exists(dest):