﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
920	[patch] patch_response_headers breaks when response.content is unicode	Sune Kirkeby <sune.kirkeby@…>	Jacob	"It's because hexdigest is not unicode-safe, so when a non-ascii unicode response.content is encoded with the default ascii encoding things break. A fix:

{{{
--- django/utils/cache.py       (revision 3523)
+++ django/utils/cache.py       (local)
@@ -75,7 +75,7 @@
     now = datetime.datetime.utcnow()
     expires = now + datetime.timedelta(0, cache_timeout)
     if not response.has_header('ETag'):
-        response['ETag'] = md5.new(response.content).hexdigest()
+        response['ETag'] = md5.new(response.content.encode('utf8')).hexdigest()
     if not response.has_header('Last-Modified'):
         response['Last-Modified'] = now.strftime('%a, %d %b %Y %H:%M:%S GMT')
     if not response.has_header('Expires'):
}}}"	defect	closed	Core (Cache system)		normal	fixed		Forest Bond	Unreviewed	1	0	0	0	0	0
