Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serial.tools.miniterm fails with "'ascii' codec can't encode characters" on German Windows #237

Closed
AndreKR opened this issue Jun 24, 2017 · 0 comments

Comments

@AndreKR
Copy link

AndreKR commented Jun 24, 2017

> python -m serial.tools.miniterm

--- Available ports:
---  1: COM6                 Intel(R) Active Management Technology - SOL (COM6)
---  2: COM13                F5521gw Mobile Broadband Device Management (COM13)
---  3: COM14                F5521gw Mobile Broadband GPS Port (COM14)
Traceback (most recent call last):
  File "C:\Users\andre\.platformio\python27\Lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Users\andre\.platformio\python27\Lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Users\andre\.platformio\penv\lib\site-packages\serial\tools\miniterm.py", line 930, in <module>
    main()
  File "C:\Users\andre\.platformio\penv\lib\site-packages\serial\tools\miniterm.py", line 857, in main
    args.port = ask_for_port()
  File "C:\Users\andre\.platformio\penv\lib\site-packages\serial\tools\miniterm.py", line 325, in ask_for_port
    sys.stderr.write('--- {:2}: {:20} {}\n'.format(n, port, desc))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-10: ordinal not in range(128)

The next COM port that would follow is called Standardmäßgige Seriell-über-Bluetooth-Verbindung, so I guess the ä and ß is to blame here.

n-eq pushed a commit to n-eq/pyserial that referenced this issue Aug 22, 2017
printing the list of ports may fail with UnicodeEncodeError.
workaround using repr.

fixes pyserial#237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant