ntoll / microrepl

A REPL client for MicroPython running on the BBC micro:bit.
Other
31 stars 17 forks source link

Fix miniterm exit character config for PySerial v3 #15

Closed carlosperate closed 6 years ago

carlosperate commented 6 years ago

There was a change on Pyserial v3 how the exit character was configured. It is no longer a module variable, and instead it was moved as member variable the Miniterm class.

That change was made for v3.0a1, so should be safe for all v3 versions: https://github.com/pyserial/pyserial/commit/442bf51bf9fa906b4600d2e99a4b83b8ed26c98e

I originally started this PR as Pyserial v2 and v3 compatible way, but then I realise Microrepl is v3 only, so this fix should be fine for all users.

There is also a bug in the Miniterm constructor that configures this value ( https://github.com/pyserial/pyserial/pull/324), which is why the default wasn't working either. This, and the original, implementation goes around that by setting our own exit character.

carlosperate commented 6 years ago

Tested on macOS 10.13 High Sierra with Python 3.6 and 2.7 with Pyserial 3.4, on Windows 10 (with #17 applied) with Python 2.7 and Pyserial 3.4, on Windows 10 (with #17 applied) with Python 3.5 and Pyserial 3.1.1.

ntoll commented 6 years ago

Thank you!