PEP 394[1] says,
"In cases where the script is expected to be executed outside virtual
environments, developers will need to be aware of the following
discrepancies across platforms and installation methods:
* Older Linux distributions will provide a python command that refers
to Python 2, and will likely not provide a python2 command.
* Some newer Linux distributions will provide a python command that
refers to Python 3.
* Some Linux distributions will not provide a python command at all by
default, but will provide a python3 command by default."
Debian has forced the issue by choosing the third option[2]:
"NOTE: Debian testing (bullseye) has removed the "python" package and
the '/usr/bin/python' symlink due to the deprecation of Python 2."
Switch our shebang from "#!/usr/bin/env python" to "#!/usr/bin/env
python3" in some places. Remove some 2/3 version checks if we know we're
running under Python 3. Remove the "coding: utf-8" in a bunch of places
since that's the default in Python 3.
[1]https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers
[2]https://wiki.debian.org/Python
Add Python 3 compatibility to indexcap.py and only create a tmpdir for
actions that need it. Only remove tmpdir for the compare action and
try to remove the temp dir even if an exception occurs.
In list_protos_in_cap.sh, rename BIN_DIR to WS_BIN_PATH (matching
test/config.sh) and allow it to be overridden from the environment.
Tested with Python 2.6.6, 2.7.9, 3.2.6, 3.4.3 as follows (with tshark
built using cmake and '-b /tmp/wsbuild/run'):
tools/indexcap.py out pop-ssl.pcapng;
tools/indexcap.py out pop-ssl.pcapng --list-all-proto;
tools/indexcap.py out pop-ssl.pcapng --list-all-files;
tools/indexcap.py out pop-ssl.pcapng --list-all-proto-files=ssl;
rm out;
Python 2.5.6 does not work (there is no multiprocessing module). The
dict output in Python 3.4.3 is different (has the hash function
changed?)
Change-Id: I592d8c4458a20d5088d815c6dd1cf90c9d3df9d3
Reviewed-on: https://code.wireshark.org/review/7792
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
There are a few things in here which could still use attention.
Don't regenerate anything now.
Change-Id: I283c224d3523212144707fca3d6265916cb11792
Reviewed-on: https://code.wireshark.org/review/205
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>