cyberdelia/django-pipeline — Issue #52: Pipeline produces URLs with backslashes on Windows.
Author: jjaksic
Created: 2011-12-06 04:49:30+00:00
State: open

Pipeline running on Windows produces URLs like this:
> /pipeline_url\css\mycss.css

The problem is in the file packager.py, method Packager.relative_path:

```python
def relative_path(self, absolute_path):
"""Rewrite paths relative to the output stylesheet path"""
absolute_path = self.absolute_path(absolute_path, settings.PIPELINE_ROOT)
return os.path.join(os.sep, relpath(absolute_path, settings.PIPELINE_ROOT))
```

This function first translates whatever file path (e.g. "css/mycss.css") into an absolute path, which on Windows contains backslashes. Then the relative path is calculated, which still contains backslashes. The result of this function is used directly in URLs (e.g. by the method individual_url) without converting backslashes into forward slashes.