Django

Code

Ticket #7156 (closed: fixed)

Opened 4 months ago

Last modified 2 months ago

win32 support in model._get_FIELD_filename()

Reported by: fcaprioli@alice.it Assigned to: nobody
Milestone: 1.0 beta Component: Database wrapper
Version: SVN Keywords: fs-rf-fixed
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

model_getfilename_win.diff (0.5 kB) - added by fcaprioli@alice.it on 05/02/08 13:06:13.

Change History

05/02/08 13:06:13 changed by fcaprioli@alice.it

  • attachment model_getfilename_win.diff added.

05/03/08 10:16:51 changed by andrey <andretmn@list.ru>

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

05/09/08 14:25:35 changed by Gulopine

  • keywords set to fs-rf.

05/09/08 14:27:24 changed by Gulopine

  • keywords changed from fs-rf to fs-rf-fixed.

06/14/08 11:04:45 changed by programmerq

  • stage changed from Unreviewed to Ready for checkin.

06/16/08 13:30:59 changed by Gulopine

  • milestone set to 1.0 beta.

06/30/08 02:17:19 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(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@alice.it.


Add/Change #7156 (win32 support in model._get_FIELD_filename())




Change Properties
Action