treewide: replace /usr/bin/python3 shebangs with env python3
Subsystems (8)
PATCH 1/1 treewide: replace /usr/bin/python3 shebangs with env python3
Use /usr/bin/env python3 instead of hardcoded interpreter paths to improve portability across environments where python3 is not installed in /usr/bin.
No functional changes intended.
--- drivers/gpu/drm/msm/registers/gen_header.py | 2 +- scripts/macro_checker.py | 2 +- tools/crypto/ccp/dbc.py | 2 +- tools/crypto/ccp/dbc_cli.py | 2 +- tools/crypto/ccp/test_dbc.py | 2 +- tools/perf/tests/shell/lib/perf_json_output_lint.py | 2 +- .../selftests/devices/probe/test_discoverable_devices.py | 2 +- tools/testing/selftests/rseq/rseq-slice-hist.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/msm/registers/gen_header.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # Copyright © 2019-2024 Google, Inc. #
scripts/macro_checker.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 # Author: Julian Sun <[email protected]>
tools/crypto/ccp/dbc.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 import ctypes
tools/crypto/ccp/dbc_cli.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 import argparse import binascii
tools/crypto/ccp/test_dbc.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 import unittest import os
tools/perf/tests/shell/lib/perf_json_output_lint.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) # Basic sanity check of perf JSON output as specified in the man page.
tools/testing/selftests/devices/probe/test_discoverable_devices.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 # # Copyright (c) 2023 Collabora Ltd
tools/testing/selftests/rseq/rseq-slice-hist.py +1 -1
@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # trace-cmd record -e hrtimer_start -e hrtimer_cancel -e hrtimer_expire_entry -- $cmd
Signature · 1 line
2.54.0
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Commit message states it replaces `#!/usr/bin/python3` shebangs and causes no functional…
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Commit message states it replaces #!/usr/bin/python3 shebangs and causes no functional changes, but actually changes #!/usr/bin/python to #!/usr/bin/env python3 in tools/perf/tests/shell/lib/perf_json_output_lint.py. --
commit 7d3e9689ede53be80434b3ba8cd07c27777d11ad
Author: Oli R <[email protected]>
treewide: replace /usr/bin/python3 shebangs with env python3
This commit replaces hardcoded /usr/bin/python3 interpreter paths with /usr/bin/env python3 to improve portability.
Quoted 1 line
treewide: replace
/usr/bin/python3shebangs with env python3
[ ... ]
Quoted 1 line
No functional changes intended.
Is this description accurate?
[ ... ]
tools/perf/tests/shell/lib/perf_json_output_lint.py line 1
Quoted 7 lines
tools/perf/tests/shell/lib/perf_json_output_lint.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3
Could this affect functionality on systems where python defaults to Python 2 or is managed differently?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Dnia piątek, 15 maja 2026 20:15:47 czas środkowoeuropejski letni piszesz:
Quoted 24 lines
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Commit message states it replaces
#!/usr/bin/python3shebangs and causes no functional changes, but actually changes#!/usr/bin/pythonto#!/usr/bin/env python3intools/perf/tests/shell/lib/perf_json_output_lint.py. --commit
7d3e9689ede53be80434b3ba8cd07c27777d11ad
Author: Oli R <[email protected]>treewide: replace
/usr/bin/python3shebangs with env python3This commit replaces hardcoded
/usr/bin/python3interpreter paths with/usr/bin/envpython3 to improve portability.Quoted 1 line
treewide: replace
/usr/bin/python3shebangs with env python3[ ... ]
Quoted 1 line
No functional changes intended.
Is this description accurate?
[ ... ]
Quoted 11 lines
tools/perf/tests/shell/lib/perf_json_output_lint.py line 1
Quoted 8 lines
(quoted diff) +0
-0
b/tools/perf/tests/shell/lib/perf_json_output_lint.pyindexdafbde56cc76f..dccafd507bb79100644tools/perf/tests/shell/lib/perf_json_output_lint.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3Could this affect functionality on systems where python defaults to Python 2 or is managed differently?
I had tested that script with python3 and it worked. The syntax anyways is Python 3 syntax, so it wont work on Python 2, so its safe to use python3.
Ian Rogers
reviewerQuoted 21 lines · On Fri, May 15, 2026 at 11:35 AM <[email protected]> wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Commit message states it replaces#!/usr/bin/python3shebangs and causes no functional changes, but actually changes#!/usr/bin/pythonto#!/usr/bin/env python3intools/perf/tests/shell/lib/perf_json_output_lint.py. --commit
7d3e9689ede53be80434b3ba8cd07c27777d11ad
Author: Oli R <[email protected]>treewide: replace
/usr/bin/python3shebangs with env python3This commit replaces hardcoded
/usr/bin/python3interpreter paths with/usr/bin/envpython3 to improve portability.Quoted 1 line
treewide: replace
/usr/bin/python3shebangs with env python3[ ... ]
Quoted 1 line
No functional changes intended.
Is this description accurate?
[ ... ]
Quoted 10 lines
tools/perf/tests/shell/lib/perf_json_output_lint.py line 1
Quoted 7 lines
tools/perf/tests/shell/lib/perf_json_output_lint.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3Could this affect functionality on systems where python defaults to Python 2 or is managed differently?
The change looks good to me, but I wonder it should be split into separate patches for the different subsystems. We do not care about Python 2, so I think some review prompt improvements are necessary.
Thanks!
Ian
Quoted 3 lines
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Ian Rogers
reviewerQuoted 34 lines · Ian Rogers
Quoted 21 lines · On Fri, May 15, 2026 at 11:35 AM <[email protected]> wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Commit message states it replaces#!/usr/bin/python3shebangs and causes no functional changes, but actually changes#!/usr/bin/pythonto#!/usr/bin/env python3intools/perf/tests/shell/lib/perf_json_output_lint.py. --commit
7d3e9689ede53be80434b3ba8cd07c27777d11ad
Author: Oli R <[email protected]>treewide: replace
/usr/bin/python3shebangs with env python3This commit replaces hardcoded
/usr/bin/python3interpreter paths with/usr/bin/envpython3 to improve portability.Quoted 1 line
treewide: replace
/usr/bin/python3shebangs with env python3[ ... ]
Quoted 1 line
No functional changes intended.
Is this description accurate?
[ ... ]
Quoted 10 lines
tools/perf/tests/shell/lib/perf_json_output_lint.py line 1
Quoted 7 lines
tools/perf/tests/shell/lib/perf_json_output_lint.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3Could this affect functionality on systems where python defaults to Python 2 or is managed differently?
Quoted 6 lines
The change looks good to me, but I wonder it should be split into separate patches for the different subsystems. We do not care about Python 2, so I think some review prompt improvements are necessary.
Thanks!
Ian
For the review prompts I sent out:
https://github.com/masoncl/review-prompts/pull/62
https://lore.kernel.org/linux-perf-users/CAP-5=fW5Wozj=F2dnXoLTWmUjudNWLyjjg95CuP3Jk9bLcYwww@mail.gmail.com/
In case you are interested, I'm trying to clean up perf's python code in this series (v1 sent Oct. 2025):
https://lore.kernel.org/linux-perf-users/[email protected]/
Testing and reviewing is always appreciated!
Thanks,
Ian
Quoted 3 lines
Quoted 3 lines
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 9 lines · Oli R
Use
/usr/bin/envpython3 instead of hardcoded interpreter paths to improve portability across environments where python3 is not installed in/usr/bin.No functional changes intended.
Signed-off-by Oli R <[email protected]>--- drivers/gpu/drm/msm/registers/gen_header.py | 2 +-
Quoted 8 lines
scripts/macro_checker.py | 2 +- tools/crypto/ccp/dbc.py | 2 +- tools/crypto/ccp/dbc_cli.py | 2 +- tools/crypto/ccp/test_dbc.py | 2 +- tools/perf/tests/shell/lib/perf_json_output_lint.py | 2 +- .../selftests/devices/probe/test_discoverable_devices.py | 2 +- tools/testing/selftests/rseq/rseq-slice-hist.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)
Signature · 2 lines
With best wishes Dmitry
Quoted 7 lines · Oli R
Use
/usr/bin/envpython3 instead of hardcoded interpreter paths to improve portability across environments where python3 is not installed in/usr/bin.No functional changes intended.
Signed-off-by Oli R <[email protected]>
Quoted 91 lines
--- drivers/gpu/drm/msm/registers/gen_header.py | 2 +- scripts/macro_checker.py | 2 +- tools/crypto/ccp/dbc.py | 2 +- tools/crypto/ccp/dbc_cli.py | 2 +- tools/crypto/ccp/test_dbc.py | 2 +- tools/perf/tests/shell/lib/perf_json_output_lint.py | 2 +- .../selftests/devices/probe/test_discoverable_devices.py | 2 +- tools/testing/selftests/rseq/rseq-slice-hist.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-)drivers/gpu/drm/msm/registers/gen_header.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # Copyright © 2019-2024 Google, Inc. #scripts/macro_checker.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 # Author: Julian Sun <[email protected]>tools/crypto/ccp/dbc.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 import ctypestools/crypto/ccp/dbc_cli.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 import argparse import binasciitools/crypto/ccp/test_dbc.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 import unittest import ostools/perf/tests/shell/lib/perf_json_output_lint.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) # Basic sanity check of perf JSON output as specified in the man page.tools/testing/selftests/devices/probe/test_discoverable_devices.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # SPDX-License-Identifier: GPL-2.0 # # Copyright (c) 2023 Collabora Ltdtools/testing/selftests/rseq/rseq-slice-hist.py +1
-1@@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # trace-cmd record -e hrtimer_start -e hrtimer_cancel -e hrtimer_expire_entry -- $cmd