Skip to content

Commit 8b0eaf2

Browse files
committed
miniterm: workaround for non ASCII port descriptions
printing the list of ports may fail with UnicodeEncodeError. workaround using repr. fixes pyserial#237
1 parent d2bf42e commit 8b0eaf2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

serial/tools/miniterm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def ask_for_port():
315315
sys.stderr.write('\n--- Available ports:\n')
316316
ports = []
317317
for n, (port, desc, hwid) in enumerate(sorted(comports()), 1):
318-
sys.stderr.write('--- {:2}: {:20} {}\n'.format(n, port, desc))
318+
sys.stderr.write('--- {:2}: {:20} {!r}\n'.format(n, port, desc))
319319
ports.append(port)
320320
while True:
321321
port = raw_input('--- Enter port index or full name: ')

0 commit comments

Comments
 (0)