From 45630d74f33b8106496989562a9222de09164695 Mon Sep 17 00:00:00 2001 From: Tim Savage Date: Fri, 10 Jan 2020 08:23:25 +1100 Subject: [PATCH] Use b''.decode() instead of str(b'') (#941) Handling of request arguments in WizardRequestHandler is not decoding bytes and rather just doing a str conversion resulting in a value of "b''" being supplied to the wizard code. --- esphome/dashboard/dashboard.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esphome/dashboard/dashboard.py b/esphome/dashboard/dashboard.py index 8aea841247..4f2d63d545 100644 --- a/esphome/dashboard/dashboard.py +++ b/esphome/dashboard/dashboard.py @@ -325,7 +325,10 @@ class WizardRequestHandler(BaseHandler): def post(self): from esphome import wizard - kwargs = {k: ''.join(str(x) for x in v) for k, v in self.request.arguments.items()} + kwargs = { + k: ''.join(x.decode() for x in v) + for k, v in self.request.arguments.items() + } destination = settings.rel_path(kwargs['name'] + '.yaml') wizard.wizard_write(path=destination, **kwargs) self.redirect('./?begin=True')