Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#193 closed defect (fixed)

Uploaded binary files are corrupted on Windows

Reported by: Steadicat Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

On Windows, binary files have to be written to disk with the 'b' flag, otherwise all line-endings are converted to CRLF.

Line 979 in source:django/trunk/django/core/meta.py#293 should be changed to:

    fp = open(getattr(self, 'get_%s_filename' % field.name)(), 'wb')

Currently all uploaded files are written to disk as text files. Binary files get corrupted as any CR or LF byte is replaced with a CRLF.

Change History (1)

comment:1 Changed 10 years ago by jacob

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

(In [311]) Fixed #193 -- thanks (again), steadicat

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