kmpm / nodemcu-uploader

Upload files to your esp8266 running nodeMcu
MIT License
319 stars 89 forks source link

Python 3 compatibility #68

Closed saintcrawler closed 7 years ago

saintcrawler commented 7 years ago

Python 3.6: all tests are passing. Python 2.7: uploading tests are failing because of encoding error. But googling tells that it's a Windows cmd problem, not Python. Maybe it will be OK on Linux.

Basically, I've just add a proxy object to serial port, which translates all data to/from bytes. Latin1 encoding does all magic.

saintcrawler commented 7 years ago

My first commit #9fc6177 has some problems with py2, so I've made a new one: #f3ff4ad, which works for both 2 and 3 versions of python and under linux and windows.

I have a feeling that I should rebase branch to remove needless 1st commit, but I'm not an expert in git and PR's so I'll leave it as is.

Also, when testing with tox don't forget to amend tox.ini file to match tested python versions and serial port env.

kmpm commented 7 years ago

Huge thanks....