Code

Opened 5 years ago

Closed 5 years ago

#9443 closed (invalid)

get_url not returning correct URL on Windows platforms

Reported by: dawidjoubert Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When calling the attribute .url on an ImageField() while running on Windows where the MEDIA_ROOT is = 'X:/sss' the url returned is incorrect.

The reason is because in django.core.files.storage.FileSystemStorage.url(self, name) ( file django/core/files/storage.py line 213 ) the function urlparse.urljoin is called as such:

return urlparse.urljoin(self.base_url, name).replace('
', '/')

For the test case self.base_url = 'http://static.klettings.dev/' and name = 'Z:\htdocs\uploads\54286.jpg' which returns a value of 'Z:/htdocs/uploads/CIMG1335.JPG' instead of 'http://static.klettings.dev/uploads/CIMG1335.JPG'

The fix / patch for this is:

Attachments (0)

Change History (1)

comment:1 in reply to: ↑ description Changed 5 years ago by dawidjoubert

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed
  • Triage Stage changed from Unreviewed to Accepted

Shit wrong bug report.

Some admin please delete this.

Thanks

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.