Opened 7 years ago

Closed 7 years ago

Last modified 4 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:


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 MEDIA_ROOT you would end up with an invalid C:

A os.path.normpath() fixes the problem; I've attached a patch

Attachments (1)

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

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by fcaprioli@…

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by Gulopine

  • Keywords fs-rf added

comment:3 Changed 7 years ago by Gulopine

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

comment:4 Changed 7 years ago by programmerq

  • Triage Stage changed from Unreviewed to Ready for checkin

comment:5 Changed 7 years ago by Gulopine

  • milestone set to 1.0 beta

comment:6 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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 4 years ago by jacob

  • milestone 1.0 beta deleted

Milestone 1.0 beta deleted

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