forked from platformio/platformio-core
Fix error with non unicode chars in serial port description
This commit is contained in:
1
examples/wiring-blink/.gitignore
vendored
1
examples/wiring-blink/.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
.pioenvs
|
.pioenvs
|
||||||
.clang_complete
|
.clang_complete
|
||||||
|
.gcc-flags.json
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
VERSION = (2, 8, "0.dev3")
|
VERSION = (2, 8, "0.dev4")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@ -272,7 +272,8 @@ def get_serialports():
|
|||||||
from serial.tools.list_ports import comports
|
from serial.tools.list_ports import comports
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise exception.GetSerialPortsError(os.name)
|
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]
|
for p, d, h in comports() if p]
|
||||||
# fix for PySerial
|
# fix for PySerial
|
||||||
if not result and system() == "Darwin":
|
if not result and system() == "Darwin":
|
||||||
|
Reference in New Issue
Block a user