Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SASSCompiler fails due to incomplete quotes in cwd #499

Closed
SverkerSbrg opened this issue Sep 16, 2015 · 1 comment
Closed

SASSCompiler fails due to incomplete quotes in cwd #499

SverkerSbrg opened this issue Sep 16, 2015 · 1 comment

Comments

@SverkerSbrg
Copy link

Hello! I've been having some trouble with pipeline and after some debugging I found the cause in the SASSCompiler. See code below.

class SASSCompiler(SubProcessCompiler):
    output_extension = 'css'

    def match_file(self, filename):
        return filename.endswith(('.scss', '.sass'))

    def compile_file(self, infile, outfile, outdated=False, force=False):
        command = "%s %s %s %s" % (
            settings.PIPELINE_SASS_BINARY,
            settings.PIPELINE_SASS_ARGUMENTS,
            infile,
            outfile
        )
        print(infile)
        print(dirname(infile))
        return self.execute_command(command, cwd=dirname(infile))

#--------------output-------------------
'C:\...\staticfiles\angular\test.scss'
'C:\...\staticfiles\angular

My print statement revealse that the dirname function accidentally (?) leaves the first of the quotes in the string which causes the command to fail.

adding dirname(infiel).replace("'", "") solves the problem.

Any ideas what is happening and what the root cause is?

I'm developing on windows 8.1 using python 2.7.9

The following sample reproduces the bug on my system

from os.path import dirname

test = "'C:/Users/test.scss'"

print(test)
print(dirname(test))

#C:\Users\Sverker\Desktop>python bug.py
#    'C:/Users/test.scss'
#    'C:/Users    

This should effect all other compilers using the cwd command as well (sass, less & stylus)

This was referenced Sep 16, 2015
@cyberdelia
Copy link
Member

Fix should be fixed by #519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants