Skip to content

Move all scripts and documentation to Python3 #6378

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

Merged
merged 9 commits into from
Aug 28, 2019

Conversation

earlephilhower
Copy link
Collaborator

Python 2 EOL is Jan 1, 2020. Migrate scripts to run under Python 3.

Under Windows, we're already running Python 3.7, by dumb luck. The
oddness is that the Windows standalone executable for Python 3 is called
"python" whereas under UNIX-like OSes it's called "python3" with
"python" always referring to the Python 2 executable. The ZIP needs to
be updated to include a Python3.exe (copy of Python.exe) so that we can
use the same command lines under Linux and Windows, and to preserve my
sanity.

Fixes #6376

Python 2 EOL is Jan 1, 2020.  Migrate scripts to run under Python 3.

Under Windows, we're already running Python 3.7, by dumb luck.  The
oddness is that the Windows standalone executable for Python 3 is called
"python" whereas under UNIX-like OSes it's called "python3" with
"python" always referring to the Python 2 executable.  The ZIP needs to
be updated to include a Python3.exe (copy of Python.exe) so that we can
use the same command lines under Linux and Windows, and to preserve my
sanity.

Fixes esp8266#6376
The order of the board opts dict changes depending on the Python version
and machine, so sort the options before printing them to get a stable
ordering.
Most scripts can run as Python 2 or Python 3 with minimal changes, so
re-add (and fix, as necessary) compatibility tweaks to the scripts.
@earlephilhower
Copy link
Collaborator Author

@earlephilhower earlephilhower added this to the 2.6.0 milestone Aug 27, 2019
@earlephilhower
Copy link
Collaborator Author

2.6.0 has a chance of being the last release before Jan 1, 2020, so adding to 2.6.0 milestone.

@earlephilhower earlephilhower merged commit 0a031ce into esp8266:master Aug 28, 2019
@earlephilhower earlephilhower deleted the python3 branch August 28, 2019 19:42
@mikekgr
Copy link

mikekgr commented Aug 29, 2019

Dear Sirs, Dear @earlephilhower ,
I did all the git master updates yesterday. In my case, that I use Windows and the Arduino 1.8.8 IDE, the simple blink.ino compilation gave me this error, ( although I have got and run the recent get.py ) :
exec: "E:\ARDUINO_ESP_DEV\arduino-IDE\hardware\esp8266com\esp8266/tools/python3/python3": file does not exist
Error compiling for board Generic ESP8266 Module.

After having a quick look, it seems that the directory that holds the python executables need to be renamed from "python" to "python3" in order to restore the normal operation. ( Alternative the calling function should try the path with "python" that is the standard directory name as it is now ).
I did this rename and I can verify the correct working compilation after that.

Thanks and Best Regards,
Mike Kranidis

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

Successfully merging this pull request may close these issues.

Migrate all scripts, symlinks, and installed tools to Python3
3 participants