Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#15521 closed (invalid)

Regression in file storage behavior following r15409

Reported by: russellm 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'

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by russellm

  • Resolution set to invalid
  • Status changed from new to closed

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 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.