diff --git a/src/rez/serialise.py b/src/rez/serialise.py index 75ca5ff08..4a5fcb3d9 100644 --- a/src/rez/serialise.py +++ b/src/rez/serialise.py @@ -73,13 +73,18 @@ def open_file_for_write(filepath, mode=None): with atomic_write(filepath, overwrite=True, **encoding) as f: f.write(content) - except WindowsError as e: - if attempt == 0: + except OSError as e: + # If we are writing to the network, we can't ensure atomicity + if e.errno == 22: + with open(filepath, "w", **encoding) as f: + f.write(content) + + elif attempt == 0: # `overwrite=True` of atomic_write doesn't restore # writability to the file being written to. os.chmod(filepath, stat.S_IWRITE | stat.S_IREAD) - else: + elif sys.platform == "win32": # Under Windows, atomic_write doesn't tell you about # which file actually failed. raise WindowsError("%s: '%s'" % (e, filepath)) diff --git a/src/rez/utils/_version.py b/src/rez/utils/_version.py index e37d8b0a4..990868f90 100644 --- a/src/rez/utils/_version.py +++ b/src/rez/utils/_version.py @@ -1,7 +1,7 @@ # Update this value to version up Rez. Do not place anything else in this file. -_rez_version = "2.69.6" +_rez_version = "2.69.7" # Copyright 2013-2016 Allan Johns.