﻿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
12397	FileSystemStorage(location='/') does not work: SuspiciousOperation	ben@…	nobody	"{{{
>>> from django.core.files.storage import FileSystemStorage
>>>
>>> LOCAL_FS = FileSystemStorage(location='/', base_url='invalid://')
>>> LOCAL_FS.path('anything')
Traceback (most recent call last):
  File ""<console>"", line 1, in <module>
  File ""/usr/local/lib/python2.5/site-packages/django/core/files/storage.py"", line 214, in path
    raise SuspiciousOperation(""Attempted access to '%s' denied."" % name)
SuspiciousOperation: Attempted access to 'anything' denied.
}}}

This is caused because safe_join expects the first character after the storage.location ('base' in safe_join) to be a separator.  When base='/foo' this is true because '/foo/anything' has a '/' after '/foo', but when path is '/' you don't get '//anything', you get '/anything', and the first character after '/' is 'a'.

I don't see a way to hack around this because of all the path normalization that goes on.  You'd think '/.' might work, but it gets normalized and then fails."	Bug	closed	File uploads/storage	1.1	Normal	fixed			Accepted	0	0	0	0	0	0
