Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Spaces in filenames cause issues with precompilers #318

Closed
flexthink opened this Issue Sep 30, 2012 · 1 comment

Comments

Projects
None yet
3 participants

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.

Contributor

karyon commented Sep 25, 2015

should be fixed since #536 :)

@diox diox closed this Sep 25, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment