]> granicus.if.org Git - esp-idf/commitdiff
idf.py: Fix encoding issue with serial port names on Windows
authorAngus Gratton <angus@espressif.com>
Fri, 17 May 2019 06:25:53 +0000 (14:25 +0800)
committerAngus Gratton <gus@projectgus.com>
Fri, 17 May 2019 06:25:53 +0000 (14:25 +0800)
Closes https://github.com/espressif/esp-idf/issues/3334

tools/idf.py

index 9435200af437349c13a5b2293e8ac47486ff47cf..ca7da50d35b1b4b19b1d4462f3b3fccc4d0cbc7c 100755 (executable)
@@ -507,7 +507,7 @@ def get_default_serial_port():
     ports = list(reversed(sorted(
         p.device for p in serial.tools.list_ports.comports())))
     try:
-        print("Choosing default port %s (use '-p PORT' option to set a specific serial port)" % ports[0])
+        print("Choosing default port %s (use '-p PORT' option to set a specific serial port)" % ports[0].encode('ascii', 'ignore'))
         return ports[0]
     except IndexError:
         raise RuntimeError("No serial ports found. Connect a device, or use '-p PORT' option to set a specific port.")