From 996b7228134dc87a5a93660337c06609b4d4eef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 3 May 2017 15:33:22 +0200 Subject: [PATCH] Fixed bug where a symlinked project path caused an issue Blender would report that the blend file wasn't in the project path, even though it was. This was caused by resolving symlinks in the project path, but not in the blendfile path. --- blender_cloud/flamenco/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/blender_cloud/flamenco/__init__.py b/blender_cloud/flamenco/__init__.py index a034aa0..a4614d1 100644 --- a/blender_cloud/flamenco/__init__.py +++ b/blender_cloud/flamenco/__init__.py @@ -477,7 +477,13 @@ def _render_output_path( return None try: - proj_rel = blend_filepath.parent.relative_to(project_path) + blend_abspath = blend_filepath.resolve().absolute() + except FileNotFoundError: + # Path.resolve() will raise a FileNotFoundError if the path doesn't exist. + return None + + try: + proj_rel = blend_abspath.parent.relative_to(project_path) except ValueError: return None