Attempt to fix failing lib link test on windows.

According to https://docs.python.org/3/library/os.html#os.rename,
`os.rename` has os-specific behavior, and will fail in case you attempt
to rename to an existing file on windows.

So using `os.replace` instead, which should be os-agnostic.

NOTE: Fact that temp test directory is not cleared after tests are
sucessfully ran does not sound great...
This commit is contained in:
Bastien Montagne 2021-11-04 15:03:55 +01:00
parent 8eff1eca52
commit d3328fabc9
Notes: blender-bot 2023-05-31 04:43:10 +02:00
Referenced by issue #92934, Crash rendering with wrong image path in image node [Compositor, Shader Editor]
Referenced by issue #91835, Adding animation data on instanced objects crashes the blender
1 changed files with 1 additions and 1 deletions

View File

@ -424,7 +424,7 @@ class TestBlendLibLibraryRelocate(TestBlendLibLinkHelper):
lib_path, lib_ext = os.path.splitext(output_lib_path)
new_lib_path = lib_path + "_relocate" + lib_ext
os.rename(output_lib_path, new_lib_path)
os.replace(output_lib_path, new_lib_path)
bpy.ops.wm.lib_relocate(library=bpy.data.objects[0].name, directory="", filename=new_lib_path)