webextensions-examples icon indicating copy to clipboard operation
webextensions-examples copied to clipboard

[Native Messaging] Python 2 was sunset January 1st, 2020

Open guest271314 opened this issue 2 years ago • 0 comments

https://www.python.org/doc/sunset-python-2/

Sunsetting Python 2

We are volunteers who make and take care of the Python programming language. We have decided that January 1, 2020, was the day that we sunset Python 2. That means that we will not improve it anymore after that day, even if someone finds a security problem in it. You should upgrade to Python 3 as soon as you can.

Python 2 was sunset/deprecated/reached EOL January 1, 2020. See this answer https://askubuntu.com/a/1311270

Python PIP is not going to be supporting Python 2 as of four days ago with the 21.0 release of the underlying pip module. If you follow the PyEnv or individual separate Python 2 installation separate from System Python and python-pip's install, you will not be able to get Python modules for Python 2 anymore.

Given that you're handling a legacy Python 2 program, I would strongly recommend you work on rewriting the program for Python 3.

to this question Ubuntu 20.04 - need Python 2 - native Python 2 install vs other options?.

Native Messaging example still tries to support Python 2

#!/usr/bin/env python

which will result in Native Messaging host not being connected to by Native Messaging client when Python 3 is the default on the system.

Either

  1. Drop support for Python 2 (https://github.com/GoogleChrome/chrome-extensions-samples/pull/617/commits/c4869b84af687293dda83562e890eb6f0a377c39); or
  2. Use #!/usr/bin/env python3 or #!/usr/bin/env -S python3 -u (https://github.com/mdn/webextensions-examples/pull/478/)

guest271314 avatar May 01 '22 16:05 guest271314