Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#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: UI/UX:

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'

Change History (2)

comment:1 Changed 6 years ago by Russell Keith-Magee

Resolution: invalid
Status: newclosed

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.

comment:2 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top