mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
idf.py: Fix encoding issue with serial port names on Windows
Closes https://github.com/espressif/esp-idf/issues/3334
This commit is contained in:
committed by
Angus Gratton
parent
f91d969c13
commit
5c0ce79f59
@@ -507,7 +507,7 @@ def get_default_serial_port():
|
|||||||
ports = list(reversed(sorted(
|
ports = list(reversed(sorted(
|
||||||
p.device for p in serial.tools.list_ports.comports())))
|
p.device for p in serial.tools.list_ports.comports())))
|
||||||
try:
|
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]
|
return ports[0]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
raise RuntimeError("No serial ports found. Connect a device, or use '-p PORT' option to set a specific port.")
|
raise RuntimeError("No serial ports found. Connect a device, or use '-p PORT' option to set a specific port.")
|
||||||
|
Reference in New Issue
Block a user