﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18487	CachedStaticFilesStorage raises an exception when trying to deal with a url() starting with //	Kit Sunde	Łukasz Balcerzak	"We have a bunch of CSS that looks like this:


{{{
background: url(//city-nomads.s3.amazonaws.com/v3-layout/header_bg_sprite.png) left -125px repeat-x;
}}}


which it tries to deal with resulting in the following stack trace:


{{{
Traceback (most recent call last):
  File ""src/city_nomads/manage.py"", line 9, in <module>
    execute_from_command_line(sys.argv)
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/core/management/__init__.py"", line 443, in execute_from_command_line
    utility.execute()
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/core/management/__init__.py"", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/core/management/base.py"", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/core/management/base.py"", line 232, in execute
    output = self.handle(*args, **options)
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/core/management/base.py"", line 371, in handle
    return self.handle_noargs(**options)
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py"", line 163, in handle_noargs
    collected = self.collect()
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py"", line 120, in collect
    for original_path, processed_path, processed in processor:
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py"", line 226, in post_process
    content = pattern.sub(converter, content)
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py"", line 167, in converter
    hashed_url = self.url(unquote(joined_result), force=True)
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py"", line 114, in url
    hashed_name = self.hashed_name(clean_name).replace('\\', '/')
  File ""/Users/kitsunde/.virtualenvs/citynomads/lib/python2.7/site-packages/django/contrib/staticfiles/storage.py"", line 74, in hashed_name
    (clean_name, self))
ValueError: The file 'unquote(joined_result' could not be found with <django.contrib.staticfiles.storage.CachedStaticFilesStorage object at 0x109a86910>.
}}}


I think the expected behavior in this case would be for it to assume it's a http:// or https:// type URL and not attempt to open it."	Bug	closed	contrib.staticfiles	1.4	Normal	fixed			Accepted	1	0	0	0	1	0
