Opened 14 years ago

Closed 14 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: no UI/UX: no


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 14 years ago by dawidjoubert

Resolution: invalid
Status: newclosed
Triage Stage: UnreviewedAccepted

Shit wrong bug report.

Some admin please delete this.


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