From 6d5fe1f629ff5f3cd454581179ba070d8a4a44f8 Mon Sep 17 00:00:00 2001 From: Justin Donofrio Date: Thu, 7 Nov 2024 10:50:51 -0500 Subject: [PATCH] Fix unicode error in logs --- src/onthespot/utils.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/onthespot/utils.py b/src/onthespot/utils.py index 7321754..6259292 100644 --- a/src/onthespot/utils.py +++ b/src/onthespot/utils.py @@ -31,11 +31,14 @@ def open_item(item): subprocess.Popen(['xdg-open', item]) -def sanitize_data(value, allow_path_separators=False, escape_quotes=False): - logger.info( - f'Sanitising string: "{value}"; ' - f'Allow path separators: {allow_path_separators}' - ) +def sanitize_data(value): + try: + logger.info( + f'Sanitising string: "{value}"; ' + f'Allow path separators: {allow_path_separators}' + ) + except UnicodeEncodeError: + pass if value is None: return '' char = config.get("illegal_character_replacement")