Opened 19 years ago

Closed 19 years ago

Last modified 17 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

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 by Jacob, 19 years ago

Resolution: fixed
Status: newclosed

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

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