From ab2668a75c8568ae87a8d6e6f631233e57e33e3b Mon Sep 17 00:00:00 2001 From: Computerboer Date: Sat, 13 Jul 2024 00:33:25 +0200 Subject: [PATCH] another fix try for the logging --- utils/helperutils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/helperutils.py b/utils/helperutils.py index 278747f..218ce23 100644 --- a/utils/helperutils.py +++ b/utils/helperutils.py @@ -1,5 +1,11 @@ from datetime import datetime, timedelta def log(value): - print(u' '.join(( str(datetime.now()), value)).encode('utf-8').strip()) - # print( str(value)) \ No newline at end of file + + try: print( str(datetime.now()) + ' ' + value) + + except UnicodeEncodeError: + print((str(datetime.now()) + ' ' + value).encode('ascii', 'ignore').decode('ascii')) + return print(str(datetime.now()) + ' print error') + + #print(u' '.join(( str(datetime.now()), value)).encode('utf-8').strip()) \ No newline at end of file