#15521 closed (invalid)
Regression in file storage behavior following r15409
Reported by: | Russell Keith-Magee | Owned by: | nobody |
---|---|---|---|
Component: | File uploads/storage | Version: | 1.2 |
Severity: | Keywords: | blocker, regression | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Reported in a comment on #15181, as a consequence of r15409:
Previously:
>>> from django.core.files.storage import DefaultStorage, settings >>> settings.configure(MEDIA_URL='http://localhost') >>> DefaultStorage().url('http://media/test') 'http://media/test'
Now:
>>> from django.core.files.storage import DefaultStorage, settings >>> settings.configure(MEDIA_URL='http://localhost') >>> DefaultStorage().url('http://media/test') 'http://localhost/http%3A//media/test'
Note:
See TracTickets
for help on using tickets.
After discussing with Jannis on IRC:
DefaultStorage will be using the FileStorage backend by default, which is the only backend that uses the filepath_to_uri call. If you are passing a URL to a FileStorage backend, it shouldn't be surprising that it gets mangled. If you've got a storage backend that is using urls, but is inheriting behavior from FileStorage backend, then that's a bug in your storage backend.
Unless we've missed something in our analysis, this should be expected behavior.