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

Mac python app does not work with latest pySerial from pip #3

Open
macostea opened this issue Mar 5, 2021 · 1 comment
Open

Mac python app does not work with latest pySerial from pip #3

macostea opened this issue Mar 5, 2021 · 1 comment

Comments

@macostea
Copy link

macostea commented Mar 5, 2021

Traceback (most recent call last):
  File "mewt/mewt.py", line 12, in <module>
    ser.write("101")
  File "mewt/venv/lib/python3.9/site-packages/serial/serialposix.py", line 616, in write
    d = to_bytes(data)
  File "mewt/venv/lib/python3.9/site-packages/serial/serialutil.py", line 65, in to_bytes
    raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq))

mewt code from master,
pyserial version: pyserial-3.5-py2.py3-none-any.whl
Python 3.9.2

This is easily fixed by replacing all instances of ser.write("string") with ser.write(b"string"). I can open a PR for it soon.

@dakota-mewt
Copy link
Owner

Hi @macostea,

Yes, please and thank you! I have very little exposure to Mac/Python. I only have access to a single Mac (2012 MacMini). After I got it working for the PC, I tried to make it work in the Mac and was able to get it working. But I wasn't able to test out any scenarios beyond the basic one.

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

2 participants