Permalink
Browse files

Fixed unicode decode error when optimizing combined files that contai…

…n unicode

new_file_content.getvalue() returns a str, but codecs.open(new_filepath, 'w', 'utf-8').write() expects unicode, else it b0rks
  • Loading branch information...
1 parent e31178d commit 4853b052482601bf7055c19f2ec86a6cd6f5814a Mark Sandstrom committed Sep 7, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 django_static/templatetags/django_static.py
@@ -507,7 +507,7 @@ def wrap_up(filename):
# Then we expect to be able to modify the content and we will
# definitely need to write a new file.
if is_combined_files:
- content = new_file_content.getvalue()
+ content = new_file_content.getvalue().decode('utf-8')
else:
#content = open(filepath).read()
content = codecs.open(filepath, 'r', 'utf-8').read()

0 comments on commit 4853b05

Please sign in to comment.