From 66ddc7b47b943c8b82b36d112c44a19f06657c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 3 Jul 2017 09:13:49 +0200 Subject: [PATCH] Fixed issue running BAM on Windows. I found this solution in a Django bug report: https://code.djangoproject.com/ticket/24160 --- blender_cloud/flamenco/bam_interface.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/blender_cloud/flamenco/bam_interface.py b/blender_cloud/flamenco/bam_interface.py index 7d4737f..160ee82 100644 --- a/blender_cloud/flamenco/bam_interface.py +++ b/blender_cloud/flamenco/bam_interface.py @@ -50,6 +50,7 @@ async def bam_copy(base_blendfile: Path, target_blendfile: Path, """ import asyncio + import os import shlex import subprocess @@ -76,9 +77,17 @@ async def bam_copy(base_blendfile: Path, target_blendfile: Path, else: pythonpath = wheel_pythonpath_278() + env = { + 'PYTHONPATH': pythonpath, + # Needed on Windows because http://bugs.python.org/issue8557 + 'PATH': os.environ['PATH'], + } + if 'SYSTEMROOT' in os.environ: # Windows http://bugs.python.org/issue20614 + env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] + proc = await asyncio.create_subprocess_exec( *args, - env={'PYTHONPATH': pythonpath}, + env=env, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,