Opened 16 years ago
Closed 16 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 |
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:
Change History (1)
comment:1 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Triage Stage: | Unreviewed → Accepted |
Shit wrong bug report.
Some admin please delete this.
Thanks