tbird20d / grabserial

Grabserial - python-based serial dump and timing program - good for embedded Linux development
GNU General Public License v2.0
195 stars 77 forks source link

pySerial write() expects byte as argument #24

Closed modbw closed 5 years ago

modbw commented 5 years ago

Fixes the following error on windows for me when typeing commands in a running grabserial instance or by passing via -c

Traceback (most recent call last): File "tools/python/grabserial.py", line 530, in grab(sys.argv[1:]) File "tools/python/grabserial.py", line 415, in grab sd.write(cmdinput + "\n") File "c:\gsPython\lib\site-packages\pyserial-3.4-py3.6.egg\serial\serialwin32.py", line 308, in write data = to_bytes(data) File "c:\gsPython\lib\site-packages\pyserial-3.4-py3.6.egg\serial\serialutil.py", line 63, in to_bytes raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq)) TypeError: unicode strings are not supported, please encode to bytes: 'run bl\n'

tbird20d commented 5 years ago

Thanks for the bug report. I went through grabserial looking for unicode errors like the one you found, and changed quite a bit of code. Please see the latest version (1.9.8).

Can you please test this and see if the changes work in your windows environment?

Thanks, -- Tim

tbird20d commented 5 years ago

I believe I have fixed this.  Thanks for the bug report. -- Tim On Thursday, August 16, 2018, 6:36:37 AM PDT, modbw notifications@github.com wrote:

Fixes the following error on windows for me when typeing commands in a running grabserial instance or by passing via -c

Traceback (most recent call last): File "tools/python/grabserial.py", line 530, in grab(sys.argv[1:]) File "tools/python/grabserial.py", line 415, in grab sd.write(cmdinput + "\n") File "c:\gsPython\lib\site-packages\pyserial-3.4-py3.6.egg\serial\serialwin32.py", line 308, in write data = to_bytes(data) File "c:\gsPython\lib\site-packages\pyserial-3.4-py3.6.egg\serial\serialutil.py", line 63, in to_bytes raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq)) TypeError: unicode strings are not supported, please encode to bytes: 'run bl\n'

You can view, comment on, or merge this pull request online at:

  https://github.com/tbird20d/grabserial/pull/24

Commit Summary

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

modbw commented 5 years ago

Latest version from git works perfectly in my environment. Thanks a lot.