code: def _codec_fails_on_encode_surrogates(codec, _cache={}):
      
  
      try:
          return _cache[codec]
      except KeyError:
          try:
              u"\uD800\uDC01".encode(codec)
          except UnicodeEncodeError:
              _cache[codec] = True
          else:
              _cache[codec] = False
          return _cache[codec]
docs: Returns if a codec fails correctly when passing in surrogates with
      a surrogatepass/surrogateescape error handler. Some codecs were broken
      in Python <3.4