Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#193 closed defect (fixed)

Uploaded binary files are corrupted on Windows

Reported by: Steadicat Owned by: Adrian Holovaty
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: no UI/UX: no


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/ should be changed to:

    fp = open(getattr(self, 'get_%s_filename' %, '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 13 years ago by Jacob

Resolution: fixed
Status: newclosed

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

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