From b17e0c298ec19476a9c741389b81f00d8571b524 Mon Sep 17 00:00:00 2001 From: Guillermo Ruffino Date: Mon, 1 Mar 2021 22:16:36 -0300 Subject: [PATCH] fix path on windows escape (#1573) --- esphome/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/core.py b/esphome/core.py index 57b065c488..2295e42753 100644 --- a/esphome/core.py +++ b/esphome/core.py @@ -339,7 +339,8 @@ class DocumentLocation: @property def as_line_directive(self): - return f'#line {self.line + 1} "{self.document}"' + document_path = str(self.document).replace('\\', '\\\\') + return f'#line {self.line + 1} "{document_path}"' class DocumentRange: