From 061b676fbca6102ae54ca2af1f0e61ea33c86180 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 14 Jun 2018 19:12:16 +0200 Subject: [PATCH] If the string assignment didn't work either, give up without failing (also in Request) --- platypush/message/request/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platypush/message/request/__init__.py b/platypush/message/request/__init__.py index 0ae83f32b..d02c18027 100644 --- a/platypush/message/request/__init__.py +++ b/platypush/message/request/__init__.py @@ -109,7 +109,11 @@ class Request(Message): try: exec('{}={}'.format(k, v)) except: - exec('{}="{}"'.format(k, v)) + if isinstance(v, str): + try: + exec('{}="{}"'.format(k, re.sub('(^|[^\\\])"', '\1\\"', v))) + except: + pass parsed_value = '' while value: