From 5cfa2b7fdd2a4843587874576a538449f8f6faf3 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 17 Oct 2019 19:28:57 +0300 Subject: [PATCH] Fix typo with UnicodeEncodeError // Issue #2796 --- platformio/fs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/fs.py b/platformio/fs.py index 080f1502..c81a50db 100644 --- a/platformio/fs.py +++ b/platformio/fs.py @@ -62,7 +62,7 @@ def write_file_contents(path, contents): try: with open(path, "w") as fp: return fp.write(contents) - except UnicodeDecodeError: + except UnicodeEncodeError: with io.open(path, "w", encoding="latin-1") as fp: return fp.write(contents)