diff --git a/scripts/matam_assembly.py b/scripts/matam_assembly.py index 293f395..0f2cf68 100755 --- a/scripts/matam_assembly.py +++ b/scripts/matam_assembly.py @@ -49,7 +49,7 @@ def update_logger_settings(logger_filepath, verbose, debug): update logging level and logging format accordinlgy to verbose/debug flag. add a file logger for root/runner logger. """ - file_handler = logging.FileHandler(filename=logger_filepath) + file_handler = logging.FileHandler(filename=logger_filepath, encoding='utf8') file_handler.formatter = logging.Formatter('%(levelname)s - %(message)s') logger.addHandler(file_handler) if debug: diff --git a/scripts/runner.py b/scripts/runner.py index 4b1508b..f99e1c3 100755 --- a/scripts/runner.py +++ b/scripts/runner.py @@ -34,7 +34,9 @@ def logged_call(command, verbose=False): with subprocess.Popen(command, stdout=stdout, stderr=stderr, shell=True, bufsize=0) as process: if verbose: while process.poll() is None: - logger.info(os.read(process.stdout.fileno(), 1024).decode("utf-8", "ignore")) + message = os.read(process.stdout.fileno(), 1024).decode() + logger.info(message) + # rehabilitate previous handler for handler in logger.handlers: