﻿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
16993	In core.cache.backends.BaseCache.default_key_func join expects character string	adsworth	adsworth	"The join in [[source:django/trunk/django/core/cache/backends/base.py#L26|core.cache.backends.BaseCache.default_key_func]] expects a character string instead of a byte string. `key_prefix` is encoded to a byte string in `BaseCache.__init__` and `key` is encoded directly in `default_key_func`.

The simple solution is wrapping `key_prefix` and `key` with `str()` for which a patch is attached. fix-cache.base.backends.get_default_key.patch

This feels backwards though, but I'm not sure about the best solution. How about calling smart_str on the result of the join and getting rid of the smart_str on `key_prefix` and `key`? For this solution I also attached a patch. This patch also works fine in py2.X if the key_prefix is a unicode string that contains ÖÄÜ!^. fix-cache.base.backends.get_default_key-smart_str_on_result.patch
 

"	Bug	closed	Python 3	1.3	Normal	invalid		adsworth	Unreviewed	1	0	0	0	0	0
