Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#7156 closed (fixed)

win32 support in model._get_FIELD_filename()

Reported by: fcaprioli@… Owned by: nobody
Component: Database layer (models, ORM) Version: master
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: UI/UX:

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@… 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by fcaprioli@…

Attachment: model_getfilename_win.diff added

comment:1 Changed 8 years ago by andrey <andretmn@…>

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 8 years ago by Marty Alchin

Keywords: fs-rf added

comment:3 Changed 8 years ago by Marty Alchin

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

comment:4 Changed 8 years ago by Jeff Anderson

Triage Stage: UnreviewedReady for checkin

comment:5 Changed 8 years ago by Marty Alchin

milestone: 1.0 beta

comment:6 Changed 8 years ago by Malcolm Tredinnick

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 Changed 5 years ago by Jacob

milestone: 1.0 beta

Milestone 1.0 beta deleted

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