substitute '%r' in string 'Cache key contains characters that will cause errors if used with memcached: %r' with key,
warnings . warn ( 'Cache key contains characters that will cause ' 'errors if used with memcached: %r' % key , CacheKeyWarning )