Opened 7 years ago

Closed 7 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:


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, name) ( file django/core/files/ 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 = '' and name = 'Z:\htdocs\uploads\54286.jpg' which returns a value of 'Z:/htdocs/uploads/CIMG1335.JPG' instead of ''

The fix / patch for this is:

Change History (1)

comment:1 in reply to: ↑ description Changed 7 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.


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