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:
committed by
Sybren A. Stüvel
parent
2843cce6fd
commit
608a7bdac9
@@ -206,7 +206,8 @@ class BlendFile:
|
||||
|
||||
self.log.debug("Copying %s to %s", self.filepath, path)
|
||||
# TODO(Sybren): remove str() calls when targeting Python 3.6+
|
||||
shutil.copy(str(self.filepath), str(path))
|
||||
# dst needs to be a file and not a directory
|
||||
shutil.copyfile(str(self.filepath), str(path))
|
||||
|
||||
self.fileobj = self._open_file(path, mode=mode)
|
||||
_cache(path, self)
|
||||
|
||||
Reference in New Issue
Block a user