From d2f3b761322cf40c1f2cfef3fd635c34d68a6986 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 25 Jan 2016 23:42:43 +0200 Subject: [PATCH] Fix error with non unicode chars in serial port description --- examples/wiring-blink/.gitignore | 1 + platformio/__init__.py | 2 +- platformio/util.py | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/wiring-blink/.gitignore b/examples/wiring-blink/.gitignore index 9984610a..5402c188 100644 --- a/examples/wiring-blink/.gitignore +++ b/examples/wiring-blink/.gitignore @@ -1,2 +1,3 @@ .pioenvs .clang_complete +.gcc-flags.json diff --git a/platformio/__init__.py b/platformio/__init__.py index b334f36b..78e2efe3 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 8, "0.dev3") +VERSION = (2, 8, "0.dev4") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/util.py b/platformio/util.py index 93289c67..63a605f7 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -272,7 +272,8 @@ def get_serialports(): from serial.tools.list_ports import comports except ImportError: raise exception.GetSerialPortsError(os.name) - result = [{"port": p, "description": d, "hwid": h} + result = [{"port": p, "description": unicode(d, errors='ignore'), + "hwid": h} for p, d, h in comports() if p] # fix for PySerial if not result and system() == "Darwin":