Closed ikv closed 6 years ago
@tbird20d ping?
Sorry - I had hoped to get this done before the Christmas holidays, but ran out of time.I've been out-of-the-office for the last week or so. I did take a look at portions of it, but didn't finish everything. I read up on some of the Python 3 string/byte handling. It looks pretty good. I hope to get to it in the nextfew days. Thanks for the submission. -- Tim
On Wednesday, December 27, 2017, 4:02:51 PM PST, Ilya Kuzmich <notifications@github.com> wrote:
@tbird20d ping?
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
I accepted two of the patches here:
I rejected two of the patches here:
BTW - thanks for the patches. It inspired me to add some linters to the code, and I'm fixing a lot of source errors now. See test.sh for some tests I'm adding to my release process.
the one for using #!/usr/bin/env - this has some disadvantages that I don't like, over the static, absolute path to the python binary.
Why? Not every environment installs python to /usr/bin/python
Regarding strings handling: python3 str is more like python2 unicode, and python3 bytes is almost like python2 str. Grabserial receives bytes from pyserial, but stdout is in text mode, not binary, therefore writing to stdout requires decoding.
Fixes python3 TabError's:
Python3 renames
thread
to_thread
, so we need to import accordingly. Also,raw_input
was renamed toinput
.Adds proper handling of bytes vs strings, because in python3 you cannot write bytes to stdout and strings to
open('wb')
file