#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.
Note:
See TracTickets
for help on using tickets.
(In [311]) Fixed #193 -- thanks (again), steadicat