From f9f05be9784016f7542d70a2b22243d67b29f0c5 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Fri, 29 Jun 2018 10:35:49 -0700 Subject: [PATCH] Encode script args for triggers --- plexpy/notification_handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index ed1a6545..4ab081ae 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -1028,7 +1028,8 @@ def build_notify_text(subject='', body='', notify_action=None, parameters=None, if agent_id == 15: try: - script_args = [custom_formatter.format(arg.decode('utf-8'), **parameters) for arg in shlex.split(subject.encode('utf-8'))] + script_args = [custom_formatter.format(arg, **parameters) + for arg in shlex.split(subject.encode(plexpy.SYS_ENCODING, 'ignore'))] except LookupError as e: logger.error(u"Tautulli NotificationHandler :: Unable to parse parameter %s in script argument. Using fallback." % e) script_args = []