diff --git a/flamenco_worker/commands.py b/flamenco_worker/commands.py index 4cd97d2bf3d0f44ec57e17e75413d118f6cd6328..588b0481044ca7fc25587d61e9bdce3659bbb871 100644 --- a/flamenco_worker/commands.py +++ b/flamenco_worker/commands.py @@ -920,6 +920,10 @@ class MergeProgressiveRendersCommand(AbstractSubprocessCommand): if '"' in output: return 'Double quotes are not allowed in filenames: %r' % output + settings['input1'] = Path(input1).as_posix() + settings['input2'] = Path(input2).as_posix() + settings['output'] = Path(output).as_posix() + _, err = self._setting(settings, 'weight1', True, int) if err: return err @@ -937,7 +941,7 @@ class MergeProgressiveRendersCommand(AbstractSubprocessCommand): '--enable-autoexec', '-noaudio', '--background', - str(blendpath), + blendpath.as_posix(), ] # set up node properties and render settings. @@ -948,7 +952,7 @@ class MergeProgressiveRendersCommand(AbstractSubprocessCommand): tmppath = Path(tmpdir) assert tmppath.exists() - settings['tmpdir'] = tmpdir + settings['tmpdir'] = tmppath.as_posix() cmd += [ '--python-expr', MERGE_EXR_PYTHON % settings ] @@ -968,6 +972,7 @@ class MergeProgressiveRendersCommand(AbstractSubprocessCommand): self._log.info('Moving %s to %s', src, dst) + assert src.exists() assert src.is_file() assert not dst.exists() or dst.is_file() assert dst.exists() or dst.parent.exists() diff --git a/tests/abstract_worker_test.py b/tests/abstract_worker_test.py index 582a8a152da8720228efa257888a649345311744..6eebb39f173999fad3f1b1a930d99e0a547cc7f0 100644 --- a/tests/abstract_worker_test.py +++ b/tests/abstract_worker_test.py @@ -1,28 +1,27 @@ +import logging +import os +import pathlib +import platform +import shutil import unittest class AbstractWorkerTest(unittest.TestCase): @classmethod def setUpClass(cls): - import logging - logging.basicConfig( level=logging.DEBUG, format='%(asctime)-15s %(levelname)8s %(name)s %(message)s', ) - def find_blender_cmd(self): - import os - import platform - + def find_blender_cmd(self) -> str: if platform.system() == 'Windows': blender = 'blender.exe' else: blender = 'blender' - for path in os.getenv('PATH').split(os.path.pathsep): - full_path = path + os.sep + blender - if os.path.exists(full_path): - return full_path + found = shutil.which(blender) + if found is None: + self.fail(f'Unable to find {blender!r} executable on $PATH') - self.fail('Unable to find "blender" executable on $PATH') + return pathlib.Path(found).as_posix()