aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-devtools/python/python3-ansible/python3-ensure-py-scripts-use-py3-for-shebang.patch
blob: 420324b7b7cd38bfcceb68bb2f9a4743be92f413 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
From f14f3a89262e9348348f6aeced9c20067a613062 Mon Sep 17 00:00:00 2001
From: Mark Asselstine <mark.asselstine@windriver.com>
Date: Thu, 11 May 2023 17:05:54 +0800
Subject: [PATCH] python3: ensure py scripts use py3 for shebang

Upstream-Status: Pending

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Rebase to 2.14.5
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Rebase to 2.16.5
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 .azure-pipelines/scripts/combine-coverage.py                  | 2 +-
 .azure-pipelines/scripts/publish-codecov.py                   | 2 +-
 .azure-pipelines/scripts/time-command.py                      | 2 +-
 hacking/ansible-profile                                       | 2 +-
 hacking/azp/download.py                                       | 2 +-
 hacking/azp/get_recent_coverage_runs.py                       | 2 +-
 hacking/azp/incidental.py                                     | 2 +-
 hacking/azp/run.py                                            | 2 +-
 hacking/backport/backport_of_line_adder.py                    | 2 +-
 hacking/create-bulk-issues.py                                 | 2 +-
 hacking/report.py                                             | 2 +-
 hacking/return_skeleton_generator.py                          | 2 +-
 hacking/test-module.py                                        | 2 +-
 hacking/tests/gen_distribution_version_testcase.py            | 2 +-
 hacking/update-sanity-requirements.py                         | 2 +-
 lib/ansible/cli/adhoc.py                                      | 2 +-
 lib/ansible/cli/config.py                                     | 2 +-
 lib/ansible/cli/console.py                                    | 2 +-
 lib/ansible/cli/doc.py                                        | 2 +-
 lib/ansible/cli/galaxy.py                                     | 2 +-
 lib/ansible/cli/inventory.py                                  | 2 +-
 lib/ansible/cli/playbook.py                                   | 2 +-
 lib/ansible/cli/pull.py                                       | 2 +-
 lib/ansible/cli/scripts/ansible_connection_cli_stub.py        | 2 +-
 lib/ansible/cli/vault.py                                      | 2 +-
 packaging/cli-doc/build.py                                    | 2 +-
 packaging/release.py                                          | 2 +-
 test/integration/targets/ansible-config/files/ini_dupes.py    | 2 +-
 .../targets/ansible-galaxy-collection/files/build_bad_tar.py  | 2 +-
 .../targets/ansible-galaxy-role/files/create-role-archive.py  | 2 +-
 test/integration/targets/ansible-test-container/runme.py      | 2 +-
 .../targets/ansible-test-integration-targets/test.py          | 2 +-
 .../ansible_collections/ns/col/run-with-pty.py                | 2 +-
 .../ns/col/tests/integration/targets/no-tty/assert-no-tty.py  | 2 +-
 .../ansible_collections/ns/col/scripts/env_python.py          | 2 +-
 .../ns/col/tests/integration/targets/valid/env_python.py      | 2 +-
 test/integration/targets/ansible-test/venv-pythons.py         | 2 +-
 test/integration/targets/ansible-vault/faux-editor.py         | 2 +-
 test/integration/targets/ansible-vault/password-script.py     | 2 +-
 test/integration/targets/ansible-vault/test-vault-client.py   | 2 +-
 .../targets/builtin_vars_prompt/test-vars_prompt.py           | 2 +-
 test/integration/targets/cli/test-cli.py                      | 2 +-
 test/integration/targets/cli/test_k_and_K.py                  | 2 +-
 test/integration/targets/collection/update-ignore.py          | 2 +-
 test/integration/targets/debugger/test_run_once.py            | 2 +-
 test/integration/targets/fork_safe_stdio/run-with-pty.py      | 2 +-
 test/integration/targets/gathering/uuid.fact                  | 2 +-
 test/integration/targets/gathering_facts/uuid.fact            | 2 +-
 test/integration/targets/module_utils/module_utils/sub/bam.py | 2 +-
 .../targets/module_utils/module_utils/sub/bam/bam.py          | 2 +-
 test/integration/targets/packaging_cli-doc/verify.py          | 2 +-
 test/integration/targets/pause/test-pause.py                  | 2 +-
 test/integration/targets/pip/files/setup.py                   | 2 +-
 .../integration/targets/service/files/ansible_test_service.py | 2 +-
 .../targets/service_facts/files/ansible_test_service.py       | 2 +-
 .../targets/template/role_filter/filter_plugins/myplugin.py   | 2 +-
 test/integration/targets/test_utils/scripts/timeout.py        | 2 +-
 test/integration/targets/throttle/test_throttle.py            | 2 +-
 .../targets/var_precedence/ansible-var-precedence-check.py    | 2 +-
 test/lib/ansible_test/_internal/util_common.py                | 2 +-
 .../_util/controller/sanity/code-smell/shebang.py             | 4 ++--
 .../ansible_test/_util/target/cli/ansible_test_cli_stub.py    | 2 +-
 test/units/executor/module_common/test_module_common.py       | 4 ++--
 63 files changed, 65 insertions(+), 65 deletions(-)

diff --git a/.azure-pipelines/scripts/combine-coverage.py b/.azure-pipelines/scripts/combine-coverage.py
index 506ade6460..15bee40234 100755
--- a/.azure-pipelines/scripts/combine-coverage.py
+++ b/.azure-pipelines/scripts/combine-coverage.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """
 Combine coverage data from multiple jobs, keeping the data only from the most recent attempt from each job.
 Coverage artifacts must be named using the format: "Coverage $(System.JobAttempt) {StableUniqueNameForEachJob}"
diff --git a/.azure-pipelines/scripts/publish-codecov.py b/.azure-pipelines/scripts/publish-codecov.py
index f2bc4b84b3..01ad32f494 100755
--- a/.azure-pipelines/scripts/publish-codecov.py
+++ b/.azure-pipelines/scripts/publish-codecov.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """
 Upload code coverage reports to codecov.io.
 Multiple coverage files from multiple languages are accepted and aggregated after upload.
diff --git a/.azure-pipelines/scripts/time-command.py b/.azure-pipelines/scripts/time-command.py
index 5e8eb8d4c8..5450c48900 100755
--- a/.azure-pipelines/scripts/time-command.py
+++ b/.azure-pipelines/scripts/time-command.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Prepends a relative timestamp to each input line from stdin and writes it to stdout."""
 
 from __future__ import (absolute_import, division, print_function)
diff --git a/hacking/ansible-profile b/hacking/ansible-profile
index 9856e7ab5c..0988bb2037 100755
--- a/hacking/ansible-profile
+++ b/hacking/ansible-profile
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
diff --git a/hacking/azp/download.py b/hacking/azp/download.py
index e0de99a27a..6ccd51b2aa 100755
--- a/hacking/azp/download.py
+++ b/hacking/azp/download.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # PYTHON_ARGCOMPLETE_OK
 
 # (c) 2016 Red Hat, Inc.
diff --git a/hacking/azp/get_recent_coverage_runs.py b/hacking/azp/get_recent_coverage_runs.py
index 1be867da1e..2fb1cc4582 100755
--- a/hacking/azp/get_recent_coverage_runs.py
+++ b/hacking/azp/get_recent_coverage_runs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # (c) 2020 Red Hat, Inc.
 #
diff --git a/hacking/azp/incidental.py b/hacking/azp/incidental.py
index 87d4d213c9..7660e2ed22 100755
--- a/hacking/azp/incidental.py
+++ b/hacking/azp/incidental.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # PYTHON_ARGCOMPLETE_OK
 
 # (c) 2020 Red Hat, Inc.
diff --git a/hacking/azp/run.py b/hacking/azp/run.py
index 00a177944f..591e6bcc4f 100755
--- a/hacking/azp/run.py
+++ b/hacking/azp/run.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # PYTHON_ARGCOMPLETE_OK
 
 # (c) 2016 Red Hat, Inc.
diff --git a/hacking/backport/backport_of_line_adder.py b/hacking/backport/backport_of_line_adder.py
index ef77ddcf40..bbec15de6a 100755
--- a/hacking/backport/backport_of_line_adder.py
+++ b/hacking/backport/backport_of_line_adder.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # (c) 2020, Red Hat, Inc. <relrod@redhat.com>
 #
 # This file is part of Ansible
diff --git a/hacking/create-bulk-issues.py b/hacking/create-bulk-issues.py
index d2651415df..2235daa5ec 100755
--- a/hacking/create-bulk-issues.py
+++ b/hacking/create-bulk-issues.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # PYTHON_ARGCOMPLETE_OK
 """Create GitHub issues for deprecated features."""
 
diff --git a/hacking/report.py b/hacking/report.py
index 58b3a6b915..78eed516dc 100755
--- a/hacking/report.py
+++ b/hacking/report.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # PYTHON_ARGCOMPLETE_OK
 """A tool to aggregate data about Ansible source and testing into a sqlite DB for reporting."""
 
diff --git a/hacking/return_skeleton_generator.py b/hacking/return_skeleton_generator.py
index 7002b7899d..cff03c38e6 100755
--- a/hacking/return_skeleton_generator.py
+++ b/hacking/return_skeleton_generator.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # (c) 2017, Will Thames <will@thames.id.au>
 #
diff --git a/hacking/test-module.py b/hacking/test-module.py
index 7a329b4b2d..a1118ba144 100755
--- a/hacking/test-module.py
+++ b/hacking/test-module.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
 #
diff --git a/hacking/tests/gen_distribution_version_testcase.py b/hacking/tests/gen_distribution_version_testcase.py
index e75c78ad91..1613b02ed5 100755
--- a/hacking/tests/gen_distribution_version_testcase.py
+++ b/hacking/tests/gen_distribution_version_testcase.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 """
 This script generated test_cases for test_distribution_version.py.
diff --git a/hacking/update-sanity-requirements.py b/hacking/update-sanity-requirements.py
index 997d6dbf87..16a47f0f3c 100755
--- a/hacking/update-sanity-requirements.py
+++ b/hacking/update-sanity-requirements.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # PYTHON_ARGCOMPLETE_OK
 """Generate frozen sanity test requirements from source requirements files."""
 
diff --git a/lib/ansible/cli/adhoc.py b/lib/ansible/cli/adhoc.py
index a54dacb70c..dc14986420 100755
--- a/lib/ansible/cli/adhoc.py
+++ b/lib/ansible/cli/adhoc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
 # Copyright: (c) 2018, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
diff --git a/lib/ansible/cli/config.py b/lib/ansible/cli/config.py
index f394ef7c1e..e37c9fd619 100755
--- a/lib/ansible/cli/config.py
+++ b/lib/ansible/cli/config.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright: (c) 2017, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
 # PYTHON_ARGCOMPLETE_OK
diff --git a/lib/ansible/cli/console.py b/lib/ansible/cli/console.py
index 2325bf05d6..475f03eb00 100755
--- a/lib/ansible/cli/console.py
+++ b/lib/ansible/cli/console.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright: (c) 2014, Nandor Sivok <dominis@haxor.hu>
 # Copyright: (c) 2016, Redhat Inc
 # Copyright: (c) 2018, Ansible Project
diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py
index 4a5c892816..c99d25d9cb 100755
--- a/lib/ansible/cli/doc.py
+++ b/lib/ansible/cli/doc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright: (c) 2014, James Tanner <tanner.jc@gmail.com>
 # Copyright: (c) 2018, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py
index 334e4bf4f0..9918f338c1 100755
--- a/lib/ansible/cli/galaxy.py
+++ b/lib/ansible/cli/galaxy.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright: (c) 2013, James Cammarata <jcammarata@ansible.com>
 # Copyright: (c) 2018-2021, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
diff --git a/lib/ansible/cli/inventory.py b/lib/ansible/cli/inventory.py
index 3550079bf8..f1da0d0531 100755
--- a/lib/ansible/cli/inventory.py
+++ b/lib/ansible/cli/inventory.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright: (c) 2017, Brian Coca <bcoca@ansible.com>
 # Copyright: (c) 2018, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
diff --git a/lib/ansible/cli/playbook.py b/lib/ansible/cli/playbook.py
index e63785b058..bc5fbc2f6f 100755
--- a/lib/ansible/cli/playbook.py
+++ b/lib/ansible/cli/playbook.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
 # Copyright: (c) 2018, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
diff --git a/lib/ansible/cli/pull.py b/lib/ansible/cli/pull.py
index f369c390ec..f0ca673b36 100755
--- a/lib/ansible/cli/pull.py
+++ b/lib/ansible/cli/pull.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
 # Copyright: (c) 2018, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
diff --git a/lib/ansible/cli/scripts/ansible_connection_cli_stub.py b/lib/ansible/cli/scripts/ansible_connection_cli_stub.py
index b1ed18c9c6..03c26d52cb 100755
--- a/lib/ansible/cli/scripts/ansible_connection_cli_stub.py
+++ b/lib/ansible/cli/scripts/ansible_connection_cli_stub.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright: (c) 2017, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
 from __future__ import (absolute_import, division, print_function)
diff --git a/lib/ansible/cli/vault.py b/lib/ansible/cli/vault.py
index cf2c9dd901..3545624a09 100755
--- a/lib/ansible/cli/vault.py
+++ b/lib/ansible/cli/vault.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # (c) 2014, James Tanner <tanner.jc@gmail.com>
 # Copyright: (c) 2018, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
diff --git a/packaging/cli-doc/build.py b/packaging/cli-doc/build.py
index 878ba8eabf..64a614f3f7 100755
--- a/packaging/cli-doc/build.py
+++ b/packaging/cli-doc/build.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # PYTHON_ARGCOMPLETE_OK
 """Build documentation for ansible-core CLI programs."""
 
diff --git a/packaging/release.py b/packaging/release.py
index 97c58a7424..fa5a27f794 100755
--- a/packaging/release.py
+++ b/packaging/release.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # PYTHON_ARGCOMPLETE_OK
 """Manage upstream ansible-core releases."""
 
diff --git a/test/integration/targets/ansible-config/files/ini_dupes.py b/test/integration/targets/ansible-config/files/ini_dupes.py
index ed42e6acb8..e61252100e 100755
--- a/test/integration/targets/ansible-config/files/ini_dupes.py
+++ b/test/integration/targets/ansible-config/files/ini_dupes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
 
 from __future__ import annotations
diff --git a/test/integration/targets/ansible-galaxy-collection/files/build_bad_tar.py b/test/integration/targets/ansible-galaxy-collection/files/build_bad_tar.py
index 6182e865db..5829df52b5 100644
--- a/test/integration/targets/ansible-galaxy-collection/files/build_bad_tar.py
+++ b/test/integration/targets/ansible-galaxy-collection/files/build_bad_tar.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # Copyright: (c) 2020, Ansible Project
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
diff --git a/test/integration/targets/ansible-galaxy-role/files/create-role-archive.py b/test/integration/targets/ansible-galaxy-role/files/create-role-archive.py
index 487666381f..86a3ea66d7 100755
--- a/test/integration/targets/ansible-galaxy-role/files/create-role-archive.py
+++ b/test/integration/targets/ansible-galaxy-role/files/create-role-archive.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Create a role archive which overwrites an arbitrary file."""
 
 import argparse
diff --git a/test/integration/targets/ansible-test-container/runme.py b/test/integration/targets/ansible-test-container/runme.py
index 3c86b6dd07..393a945ff9 100755
--- a/test/integration/targets/ansible-test-container/runme.py
+++ b/test/integration/targets/ansible-test-container/runme.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Test suite used to verify ansible-test is able to run its containers on various container hosts."""
 
 from __future__ import annotations
diff --git a/test/integration/targets/ansible-test-integration-targets/test.py b/test/integration/targets/ansible-test-integration-targets/test.py
index 8effb647fc..4e34c4bbc1 100755
--- a/test/integration/targets/ansible-test-integration-targets/test.py
+++ b/test/integration/targets/ansible-test-integration-targets/test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import subprocess
 import unittest
diff --git a/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/run-with-pty.py b/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/run-with-pty.py
index 463915284b..fc2ed398d9 100755
--- a/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/run-with-pty.py
+++ b/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/run-with-pty.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Run a command using a PTY."""
 
 import sys
diff --git a/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/tests/integration/targets/no-tty/assert-no-tty.py b/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/tests/integration/targets/no-tty/assert-no-tty.py
index a2b094e2fc..355dba697a 100755
--- a/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/tests/integration/targets/no-tty/assert-no-tty.py
+++ b/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/tests/integration/targets/no-tty/assert-no-tty.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Assert no TTY is available."""
 
 import sys
diff --git a/test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/scripts/env_python.py b/test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/scripts/env_python.py
index 4265cc3e6c..e5a0d9b483 100755
--- a/test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/scripts/env_python.py
+++ b/test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/scripts/env_python.py
@@ -1 +1 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
diff --git a/test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/tests/integration/targets/valid/env_python.py b/test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/tests/integration/targets/valid/env_python.py
index 4265cc3e6c..e5a0d9b483 100755
--- a/test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/tests/integration/targets/valid/env_python.py
+++ b/test/integration/targets/ansible-test-sanity-shebang/ansible_collections/ns/col/tests/integration/targets/valid/env_python.py
@@ -1 +1 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
diff --git a/test/integration/targets/ansible-test/venv-pythons.py b/test/integration/targets/ansible-test/venv-pythons.py
index 97998bcd7c..aace3d346d 100755
--- a/test/integration/targets/ansible-test/venv-pythons.py
+++ b/test/integration/targets/ansible-test/venv-pythons.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Return target Python options for use with ansible-test."""
 
 import argparse
diff --git a/test/integration/targets/ansible-vault/faux-editor.py b/test/integration/targets/ansible-vault/faux-editor.py
index b67c747563..a30c306a83 100755
--- a/test/integration/targets/ansible-vault/faux-editor.py
+++ b/test/integration/targets/ansible-vault/faux-editor.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Ansible is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/test/integration/targets/ansible-vault/password-script.py b/test/integration/targets/ansible-vault/password-script.py
index 1b7f02beb2..0dcada23c7 100755
--- a/test/integration/targets/ansible-vault/password-script.py
+++ b/test/integration/targets/ansible-vault/password-script.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Ansible is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff --git a/test/integration/targets/ansible-vault/test-vault-client.py b/test/integration/targets/ansible-vault/test-vault-client.py
index ee46188742..48244fca09 100755
--- a/test/integration/targets/ansible-vault/test-vault-client.py
+++ b/test/integration/targets/ansible-vault/test-vault-client.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 from __future__ import (absolute_import, division, print_function)
diff --git a/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py b/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py
index 93958fc2ad..33509c826a 100644
--- a/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py
+++ b/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
diff --git a/test/integration/targets/cli/test-cli.py b/test/integration/targets/cli/test-cli.py
index 9893d6652e..7a07dcc108 100644
--- a/test/integration/targets/cli/test-cli.py
+++ b/test/integration/targets/cli/test-cli.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # Copyright (c) 2019 Matt Martz <matt@sivel.net>
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
 
diff --git a/test/integration/targets/cli/test_k_and_K.py b/test/integration/targets/cli/test_k_and_K.py
index f7077fba0a..dcc9614129 100644
--- a/test/integration/targets/cli/test_k_and_K.py
+++ b/test/integration/targets/cli/test_k_and_K.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
 
 # Make coding more python3-ish
diff --git a/test/integration/targets/collection/update-ignore.py b/test/integration/targets/collection/update-ignore.py
index 92a702cf13..9ea69089d5 100755
--- a/test/integration/targets/collection/update-ignore.py
+++ b/test/integration/targets/collection/update-ignore.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Rewrite a sanity ignore file to expand Python versions for import ignores and write the file out with the correct Ansible version in the name."""
 
 import os
diff --git a/test/integration/targets/debugger/test_run_once.py b/test/integration/targets/debugger/test_run_once.py
index 237f9c2d90..4fe74903d8 100755
--- a/test/integration/targets/debugger/test_run_once.py
+++ b/test/integration/targets/debugger/test_run_once.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import io
 import os
diff --git a/test/integration/targets/fork_safe_stdio/run-with-pty.py b/test/integration/targets/fork_safe_stdio/run-with-pty.py
index 463915284b..fc2ed398d9 100755
--- a/test/integration/targets/fork_safe_stdio/run-with-pty.py
+++ b/test/integration/targets/fork_safe_stdio/run-with-pty.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Run a command using a PTY."""
 
 import sys
diff --git a/test/integration/targets/gathering/uuid.fact b/test/integration/targets/gathering/uuid.fact
index 79e3f62677..2a294b33a8 100644
--- a/test/integration/targets/gathering/uuid.fact
+++ b/test/integration/targets/gathering/uuid.fact
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 
diff --git a/test/integration/targets/gathering_facts/uuid.fact b/test/integration/targets/gathering_facts/uuid.fact
index 79e3f62677..2a294b33a8 100644
--- a/test/integration/targets/gathering_facts/uuid.fact
+++ b/test/integration/targets/gathering_facts/uuid.fact
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 
diff --git a/test/integration/targets/module_utils/module_utils/sub/bam.py b/test/integration/targets/module_utils/module_utils/sub/bam.py
index 566f8b7c47..0814485d5f 100644
--- a/test/integration/targets/module_utils/module_utils/sub/bam.py
+++ b/test/integration/targets/module_utils/module_utils/sub/bam.py
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 bam = "BAM FROM sub/bam.py"
diff --git a/test/integration/targets/module_utils/module_utils/sub/bam/bam.py b/test/integration/targets/module_utils/module_utils/sub/bam/bam.py
index b7ed707211..97f9eedcdb 100644
--- a/test/integration/targets/module_utils/module_utils/sub/bam/bam.py
+++ b/test/integration/targets/module_utils/module_utils/sub/bam/bam.py
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 bam = "BAM FROM sub/bam/bam.py"
diff --git a/test/integration/targets/packaging_cli-doc/verify.py b/test/integration/targets/packaging_cli-doc/verify.py
index 7793fa8c24..71f82186dd 100755
--- a/test/integration/targets/packaging_cli-doc/verify.py
+++ b/test/integration/targets/packaging_cli-doc/verify.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import os
 import pathlib
diff --git a/test/integration/targets/pause/test-pause.py b/test/integration/targets/pause/test-pause.py
index ab771fa09e..1dece083d3 100755
--- a/test/integration/targets/pause/test-pause.py
+++ b/test/integration/targets/pause/test-pause.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
diff --git a/test/integration/targets/pip/files/setup.py b/test/integration/targets/pip/files/setup.py
index aaf21875ca..2835719e4f 100755
--- a/test/integration/targets/pip/files/setup.py
+++ b/test/integration/targets/pip/files/setup.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
diff --git a/test/integration/targets/service/files/ansible_test_service.py b/test/integration/targets/service/files/ansible_test_service.py
index 6292272e63..e5664fb2e3 100644
--- a/test/integration/targets/service/files/ansible_test_service.py
+++ b/test/integration/targets/service/files/ansible_test_service.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # this is mostly based off of the code found here:
 # http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
diff --git a/test/integration/targets/service_facts/files/ansible_test_service.py b/test/integration/targets/service_facts/files/ansible_test_service.py
index 19f1e29138..609218325d 100644
--- a/test/integration/targets/service_facts/files/ansible_test_service.py
+++ b/test/integration/targets/service_facts/files/ansible_test_service.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # this is mostly based off of the code found here:
 # http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
diff --git a/test/integration/targets/template/role_filter/filter_plugins/myplugin.py b/test/integration/targets/template/role_filter/filter_plugins/myplugin.py
index b0a8889439..90c83b582b 100644
--- a/test/integration/targets/template/role_filter/filter_plugins/myplugin.py
+++ b/test/integration/targets/template/role_filter/filter_plugins/myplugin.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
diff --git a/test/integration/targets/test_utils/scripts/timeout.py b/test/integration/targets/test_utils/scripts/timeout.py
index f88f3e4e15..c312dc4f6c 100755
--- a/test/integration/targets/test_utils/scripts/timeout.py
+++ b/test/integration/targets/test_utils/scripts/timeout.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import argparse
 import subprocess
diff --git a/test/integration/targets/throttle/test_throttle.py b/test/integration/targets/throttle/test_throttle.py
index 1a5bdd3078..344bcf0f86 100755
--- a/test/integration/targets/throttle/test_throttle.py
+++ b/test/integration/targets/throttle/test_throttle.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
diff --git a/test/integration/targets/var_precedence/ansible-var-precedence-check.py b/test/integration/targets/var_precedence/ansible-var-precedence-check.py
index b03c87b80f..2035463092 100755
--- a/test/integration/targets/var_precedence/ansible-var-precedence-check.py
+++ b/test/integration/targets/var_precedence/ansible-var-precedence-check.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # A tool to check the order of precedence for ansible variables
 # https://github.com/ansible/ansible/blob/devel/test/integration/test_var_precedence.yml
diff --git a/test/lib/ansible_test/_internal/util_common.py b/test/lib/ansible_test/_internal/util_common.py
index 77a6165c8e..865158e3b1 100644
--- a/test/lib/ansible_test/_internal/util_common.py
+++ b/test/lib/ansible_test/_internal/util_common.py
@@ -303,7 +303,7 @@ def get_injector_path() -> str:
     ])
 
     scripts = (
-        ('python.py', '/usr/bin/env python', MODE_FILE_EXECUTE),
+        ('python.py', '/usr/bin/env python3', MODE_FILE_EXECUTE),
         ('virtualenv.sh', '/usr/bin/env bash', MODE_FILE),
     )
 
diff --git a/test/lib/ansible_test/_util/controller/sanity/code-smell/shebang.py b/test/lib/ansible_test/_util/controller/sanity/code-smell/shebang.py
index b0b1319783..9535c3b481 100644
--- a/test/lib/ansible_test/_util/controller/sanity/code-smell/shebang.py
+++ b/test/lib/ansible_test/_util/controller/sanity/code-smell/shebang.py
@@ -16,14 +16,14 @@ def main():
         b'#!/usr/bin/env bash',
         b'#!/usr/bin/env fish',
         b'#!/usr/bin/env pwsh',
-        b'#!/usr/bin/env python',
+        b'#!/usr/bin/env python3',
         b'#!/usr/bin/make -f',
     ])
 
     integration_shebangs = set([
         b'#!/bin/sh',
         b'#!/usr/bin/env bash',
-        b'#!/usr/bin/env python',
+        b'#!/usr/bin/env python3',
     ])
 
     module_shebangs = {
diff --git a/test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py b/test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py
index 930654fc1e..bbf50369d7 100755
--- a/test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py
+++ b/test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # PYTHON_ARGCOMPLETE_OK
 """Command line entry point for ansible-test."""
 
diff --git a/test/units/executor/module_common/test_module_common.py b/test/units/executor/module_common/test_module_common.py
index 6e2a4956c4..6776de66e1 100644
--- a/test/units/executor/module_common/test_module_common.py
+++ b/test/units/executor/module_common/test_module_common.py
@@ -117,8 +117,8 @@ class TestGetShebang:
             (u'#!/usr/bin/python3 -tt -OO', u'/usr/bin/python3')
 
     def test_python_via_env(self, templar):
-        assert amc._get_shebang(u'/usr/bin/python', {u'ansible_python_interpreter': u'/usr/bin/env python'}, templar) == \
-            (u'#!/usr/bin/env python', u'/usr/bin/env python')
+        assert amc._get_shebang(u'/usr/bin/python', {u'ansible_python_interpreter': u'/usr/bin/env python3'}, templar) == \
+            (u'#!/usr/bin/env python3', u'/usr/bin/env python3')
 
 
 class TestDetectionRegexes:
-- 
2.25.1