packager.py
5.14 KB
-
Fixing an issue when for files which contain unicode data · 08bf1b19
The django.core.files.base module uses the cStringIO package where available. However, unlike StringIO, cStringIO does not support unicode data, and the result is additional null bytes being entered into the output file. The trick seems to be to convert the data into a byte string before passing it into ContentFile, which I do here using Django's smart_str() utility. Signed-off-by: Timothée Peignier <timothee.peignier@tryphon.org>
Adam Charnock committed