Compatibility with packing read-only source files

File permissions are no longer copied when packing. This means that
read-only source files can still be packed without errors, even when
they have to be rewritten (due to changed paths).

Reviewed by: sybren

Differential Revision: https://developer.blender.org/D13128
This commit is contained in:
Ethan Simon
2021-11-09 11:15:20 +01:00
committed by Sybren A. Stüvel
parent 2843cce6fd
commit 608a7bdac9
3 changed files with 39 additions and 5 deletions
+3 -3
View File
@@ -152,12 +152,12 @@ class FileCopier(transfer.FileTransferer):
return True
def _move(self, srcpath: pathlib.Path, dstpath: pathlib.Path):
"""Low-level file move"""
"""Low-level file move."""
shutil.move(str(srcpath), str(dstpath))
def _copy(self, srcpath: pathlib.Path, dstpath: pathlib.Path):
"""Low-level file copy"""
shutil.copy2(str(srcpath), str(dstpath))
"""Low-level file copy. dstpath needs to be a file and not a directory."""
shutil.copyfile(str(srcpath), str(dstpath))
def move(self, srcpath: pathlib.Path, dstpath: pathlib.Path):
s_stat = srcpath.stat()