From d6fa2ebf9b3c53daec63e2ccd23feb87335a1e81 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Tue, 29 Sep 2020 17:09:11 +0300 Subject: Add check for bytes * wqflask/wqflask/collect.py (process_traits): Check whether the passed "unprocessed_traits" is a byte otherwise an error is generated when bytes(the default) are passed. --- wqflask/wqflask/collect.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/collect.py b/wqflask/wqflask/collect.py index 15383603..e7dac72a 100644 --- a/wqflask/wqflask/collect.py +++ b/wqflask/wqflask/collect.py @@ -35,7 +35,9 @@ from utility.logger import getLogger logger = getLogger(__name__) def process_traits(unprocessed_traits): - if isinstance(unprocessed_traits, str): + if isinstance(unprocessed_traits, bytes): + unprocessed_traits = unprocessed_traits.decode('utf-8').split(",") + else: # It's a string unprocessed_traits = unprocessed_traits.split(",") traits = set() for trait in unprocessed_traits: -- cgit v1.2.3