71 logging.getLogger(__name__).addHandler(logging.NullHandler())
74 def log_decode_error_handler(err):
76 A custom error handler for use when reading files. Removes any 77 characters that cause decoding errors and logs the error. 79 :returns: 2-tuple containing replacement for bad chars (an empty string \ 80 and the position from where encoding should continue. 81 :rtype: Tuple[str, int] 84 message = f
"character in input file. Error returned was {str(err)}." 86 logging.getLogger(__name__).warning(
"Skipped bad %s", message)
90 codecs.register_error(
"fparser-logging", log_decode_error_handler)