Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Spaces in filenames cause issues with precompilers #318

Open
catoworld opened this Issue · 0 comments

1 participant

@catoworld

The recommended way to set up a LESS precompiler in the documentation is as follows:

COMPRESS_PRECOMPILERS = (
    ('text/coffeescript', 'coffee --compile --stdio'),
    ('text/less', 'lessc {infile} {outfile}'),
    ('text/x-sass', 'sass {infile} {outfile}'),
    ('text/x-scss', 'sass --scss {infile} {outfile}'),
    ('text/foobar', 'path.to.MyPrecompilerFilter'),
)

Source: http://django_compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_PRECOMPILERS

This doesn't seem to work if the filename contains spaces. A good example is the default Aptana workspace directory:

"Aptana Studio 3 Workspace"

I was able to fix it by putting quotes around the file name:

COMPRESS_PRECOMPILERS = (
   ('text/less', 'lessc "{infile}" "{outfile}"'),
)

However, this could be unreliable if the input file name contains special characters.

Given that the input is ultimately coming from a URL, it might be better to escape the input the way the subprocess module does it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.