Skip to content

Commit

Permalink
Fix unicode error in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Nov 7, 2024
1 parent 0347de1 commit 6d5fe1f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/onthespot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 6d5fe1f

Please sign in to comment.