From c867a21104e7b98102fdb54e79ec885839b6f16b Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 6 Jun 2018 18:50:09 +0200 Subject: [PATCH] If the value is a platypush Message, then converting it into a string would result in a JSON dumps that might break the interpreter (e.g. 'null' is a valid JSON keyword but it's not recognized by Python). Therefore first parse the variable from JSON --- platypush/message/request/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platypush/message/request/__init__.py b/platypush/message/request/__init__.py index b24185ce2..03aa660e2 100644 --- a/platypush/message/request/__init__.py +++ b/platypush/message/request/__init__.py @@ -101,6 +101,8 @@ class Request(Message): @classmethod def expand_value_from_context(cls, value, **context): for (k, v) in context.items(): + if isinstance(v, Message): + v = json.loads(str(v)) exec('{}={}'.format(k, v)) parsed_value = ''