Opened 17 years ago

Closed 16 years ago

Last modified 13 years ago

#7156 closed (fixed)

win32 support in model._get_FIELD_filename()

Reported by: fcaprioli@… 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)

model_getfilename_win.diff (516 bytes ) - added by fcaprioli@… 17 years ago.

Download all attachments as: .zip

Change History (8)

by fcaprioli@…, 17 years ago

Attachment: model_getfilename_win.diff added

comment:1 by andrey <andretmn@…>, 17 years ago

comment:2 by Marty Alchin, 17 years ago

Keywords: fs-rf added

comment:3 by Marty Alchin, 17 years ago

Keywords: fs-rf-fixed added; fs-rf removed

comment:4 by Jeff Anderson, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:5 by Marty Alchin, 17 years ago

milestone: 1.0 beta

comment:6 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(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@….

comment:7 by Jacob, 13 years ago

milestone: 1.0 beta

Milestone 1.0 beta deleted

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