From b3b27525543b5c9e5b30c1ded90ebaacc10cc668 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sun, 27 Dec 2020 13:15:06 -0800 Subject: [PATCH] Fix regex masking in logger args --- plexpy/logger.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/plexpy/logger.py b/plexpy/logger.py index ebce0e79..cb0efc42 100644 --- a/plexpy/logger.py +++ b/plexpy/logger.py @@ -131,9 +131,15 @@ class RegexFilter(logging.Filter): args = [] for arg in record.args: - matches = self.regex.findall(arg) if isinstance(arg, str) else [] - for match in matches: - arg = self.replace(arg, match) + try: + arg_str = str(arg) + matches = self.regex.findall(arg_str) + if matches: + for match in matches: + arg_str = self.replace(arg_str, match) + arg = arg_str + except: + pass args.append(arg) record.args = tuple(args) except: