I'm trying to call sass from python and I'm struggling to make it work.
If I run the following command from my CLI it works:
sass /path/to/style.scss /path/to/style.css --style=compressed
This works until I try to call it through my python script:
import subprocess
subprocess.check_output(['sass', '/path/to/style.scss', '/path/to/style.css', '--style=compressed'])
I get the following error:
Syntax error: Invalid US-ASCII character "\xE2"
I've read that I can fix this by adding @charset "UTF-8";
at the top of each file that has encoding errors.
The problem is there are lots of files and many are in bower packages so adding to them is not the best solution.
I've read that I can append the following option to sass: --default-encoding="UTF-8"
, but when I try this I get this error both on the CLI and in Python:
ArgumentError: unknown encoding name - "UTF-8"
Anyone know any other workarounds, or why it would work on the CLI and not by calling it via python?