Commit 91dede72 by Timothée Peignier

quote path before passing them to command. fix #335

parent 3e2cd9b8
...@@ -2,6 +2,11 @@ from __future__ import unicode_literals ...@@ -2,6 +2,11 @@ from __future__ import unicode_literals
import os import os
try:
from shlex import quote
except ImportError:
from pipes import quote
from django.contrib.staticfiles import finders from django.contrib.staticfiles import finders
from django.core.files.base import ContentFile from django.core.files.base import ContentFile
from django.utils.encoding import smart_str, smart_bytes from django.utils.encoding import smart_str, smart_bytes
...@@ -31,7 +36,8 @@ class Compiler(object): ...@@ -31,7 +36,8 @@ class Compiler(object):
outfile = self.output_path(infile, compiler.output_extension) outfile = self.output_path(infile, compiler.output_extension)
outdated = compiler.is_outdated(input_path, output_path) outdated = compiler.is_outdated(input_path, output_path)
try: try:
compiler.compile_file(infile, outfile, outdated=outdated, force=force) compiler.compile_file(quote(infile), quote(outfile),
outdated=outdated, force=force)
except CompilerError: except CompilerError:
if not self.storage.exists(output_path) or settings.DEBUG: if not self.storage.exists(output_path) or settings.DEBUG:
raise raise
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment