code: def register_surrogateescape():
      
      if six.PY3:
          return
      try:
          codecs.lookup_error(FS_ERRORS)
      except LookupError:
          codecs.register_error(FS_ERRORS, surrogateescape_handler)
docs: Registers the surrogateescape error handler on Python 2 (only)