#7156 closed (fixed)
win32 support in model._get_FIELD_filename()
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | fs-rf-fixed | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
There is a small cornercase in Model._get_FIELD_filename where it returns a wrong path on win32: if you have a unix path (/foo/bar/file) stored in the database, and are on a win32 server with a C:
Path
Path MEDIA_ROOT you would end up with an invalid C:
Path
Path/foo/bar/file
A os.path.normpath() fixes the problem; I've attached a patch
Attachments (1)
Change History (8)
by , 17 years ago
Attachment: | model_getfilename_win.diff added |
---|
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Keywords: | fs-rf added |
---|
comment:3 by , 17 years ago
Keywords: | fs-rf-fixed added; fs-rf removed |
---|
comment:4 by , 17 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:5 by , 17 years ago
milestone: | → 1.0 beta |
---|
comment:6 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(In [7795]) Fixed #7156 -- Normalise file paths before returning them in models.
This avoids problems with a database that was created on Unix being used on
Windows and giving interesting results. Patch from fcaprioli@….