From 66dd9b34532eb1918ca3121dcd72aa942bf0192b Mon Sep 17 00:00:00 2001 From: Wafffle77 <97140942+Wafffle77@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:13:16 -0600 Subject: [PATCH] Fix Syntax and Type Errors Fixed the type error on Line 901 by encoding the data string into a Bytes object for socket.sendto(). Added the missing '%' for the format string on Line 1134. --- src/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.py b/src/core.py index 2ef05e4..71625da 100644 --- a/src/core.py +++ b/src/core.py @@ -898,7 +898,7 @@ def syslog_send( # Send syslog UDP packet to given host and port. sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) data = '<%d>%s' % (level + facility * 8, message + "\n") - sock.sendto(data, (host, port)) + sock.sendto(data.encode("ascii"), (host, port)) sock.close() # send the syslog message @@ -1131,7 +1131,7 @@ def format_ips(url): write_log(final_msg) if is_posix(): write_log( - "Received URL Error trying to download feed from '%s', Reason: %s" (urls, format(err)),1) + "Received URL Error trying to download feed from '%s', Reason: %s" % (urls, format(err)),1) try: if is_windows():