def _sha1_mangle_key(key):
 try:
  key = key.encode('utf-8', errors='xmlcharrefreplace')
 except (UnicodeError, AttributeError):
  pass
 return util.sha1_mangle_key(key)

def _sha1_mangle_key ( key ) : try : key = key . encode ( 'utf-8' , errors = 'xmlcharrefreplace' ) except ( UnicodeError , AttributeError ) : pass return util . sha1_mangle_key ( key )
wrapper for dogpiles sha1_mangle_key .