From e2b35fbaf9bd0b05dd690f38e9e2f6b15ec4ee74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ko=C5=88a=C5=99=C3=ADk?= Date: Wed, 24 May 2017 19:56:19 +0200 Subject: [PATCH 1/2] Fix crash caused by mixup of bytes and str Popen.communicate() return a tuple of bytes, but the rest of the code expects str. Decoding the bytes object fixes this. Some (very weird) outputs may now fail with UnicodeDecodeError, but that'd probably be indicative of a bug elsewhere. --- pipeline_browserify/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipeline_browserify/compiler.py b/pipeline_browserify/compiler.py index 6868aeb..5e56712 100755 --- a/pipeline_browserify/compiler.py +++ b/pipeline_browserify/compiler.py @@ -25,7 +25,7 @@ def simple_execute_command(self, cmd, **kwargs): print(stderr) if pipe.returncode != 0: raise CompilerError("Compiler returned non-zero exit status %i" % pipe.returncode, command=cmd, error_output=stderr) - return stdout + return stdout.decode() def _get_cmd_parts(self): pipeline_settings = getattr(settings, 'PIPELINE', {}) From c150b39b53251e6531aa1719ea124faf25bba2db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ko=C5=88a=C5=99=C3=ADk?= Date: Sat, 10 Jun 2017 11:36:04 +0200 Subject: [PATCH 2/2] Add compatibility import for Python 2 --- pipeline_browserify/compiler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pipeline_browserify/compiler.py b/pipeline_browserify/compiler.py index 5e56712..d99093f 100755 --- a/pipeline_browserify/compiler.py +++ b/pipeline_browserify/compiler.py @@ -1,3 +1,5 @@ +from __future__ import print_function + from pipeline.compilers import SubProcessCompiler from django.conf import settings from django.core.exceptions import SuspiciousFileOperation