def register_surrogateescape():
 if PY3:
  return
 try:
  codecs.lookup_error(FS_ERRORS)
 except LookupError:
  codecs.register_error(FS_ERRORS, surrogateescape_handler)

def register_surrogateescape ( ) : if PY3 : return try : codecs . lookup_error ( FS_ERRORS ) except LookupError : codecs . register_error ( FS_ERRORS , surrogateescape_handler )
registers the surrogateescape error handler on python 2 .