replace the result for tz_name. call the method tz_name.encode with the arguments 'ascii' and 'ignore', call the method decode on the result with 'ascii' as argument,
cache_key += '.%s' % tz_name . encode ( 'ascii' , 'ignore' ) . decode ( 'ascii' ) . replace ( ' ' , '_' )