summaryrefslogtreecommitdiff
path: root/debian/patches/0005-use-py3.patch
blob: f18d613333e5e0499625394ab2dd3c21bbd7c5f6 (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
Description: use py3
 Use python 3 for all helper scripts during build
 .
 This allows us to not depend on python 2 anymore for building.
--- a/docs/bin/find-plugin-refs.py
+++ b/docs/bin/find-plugin-refs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # To run this script, first make webdocs in the toplevel of the checkout.  This will generate all
 # rst files from their sources.  Then run this script ./docs/bin/find-plugin-refs.py
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@
 ASCII2MAN = @echo "ERROR: rst2man from docutils command is not installed but is required to build $(MANPAGES)" && exit 1
 endif
 
-PYTHON=python
+PYTHON=python3
 GENERATE_CLI = hacking/build-ansible.py generate-man
 
 # fetch version from project release.py as single source-of-truth
--- a/lib/ansible/cli/scripts/ansible_cli_stub.py
+++ b/lib/ansible/cli/scripts/ansible_cli_stub.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
 #
--- 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)
--- a/packaging/sdist/check-link-behavior.py
+++ b/packaging/sdist/check-link-behavior.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Checks for link behavior required for sdist to retain symlinks."""
 
 from __future__ import (absolute_import, division, print_function)
--- 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)
 
--- 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 -*-
 
 
--- 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 -*-
 
 
--- a/test/integration/targets/group/files/gidget.py
+++ b/test/integration/targets/group/files/gidget.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import grp
 
--- a/test/integration/targets/module_utils/module_utils/foo.py
+++ b/test/integration/targets/module_utils/module_utils/foo.py
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 foo = "FOO FROM foo.py"
--- 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"
--- 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"
--- a/test/integration/targets/module_utils/module_utils/sub/bar/bam.py
+++ b/test/integration/targets/module_utils/module_utils/sub/bar/bam.py
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 bam = "BAM FROM sub/bar/bam.py"
--- a/test/integration/targets/module_utils/module_utils/sub/bar/bar.py
+++ b/test/integration/targets/module_utils/module_utils/sub/bar/bar.py
@@ -1,3 +1,3 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 bar = "BAR FROM sub/bar/bar.py"
--- 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
 
 import os
 import pexpect
--- 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 setuptools import setup, find_packages
 
--- 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/
--- a/test/integration/targets/setup_rpm_repo/files/create-repo.py
+++ b/test/integration/targets/setup_rpm_repo/files/create-repo.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 
 import sys
--- 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
 
 
 class FilterModule(object):
--- 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
--- 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
--- a/test/integration/targets/vault/faux-editor.py
+++ b/test/integration/targets/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
--- a/test/integration/targets/vault/password-script.py
+++ b/test/integration/targets/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
--- a/test/integration/targets/vault/test-vault-client.py
+++ b/test/integration/targets/vault/test-vault-client.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 ANSIBLE_METADATA = {'status': ['preview'],
--- a/test/lib/ansible_test/_data/cli/ansible_test_cli_stub.py
+++ b/test/lib/ansible_test/_data/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."""
 
--- a/test/lib/ansible_test/_data/injector/python.py
+++ b/test/lib/ansible_test/_data/injector/python.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Provides an entry point for python scripts and python modules on the controller with the current python interpreter and optional code coverage collection."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/lib/ansible_test/_data/sanity/code-smell/action-plugin-docs.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/action-plugin-docs.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Test to verify action plugins have an associated module to provide documentation."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/lib/ansible_test/_data/sanity/code-smell/empty-init.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/empty-init.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/future-import-boilerplate.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/future-import-boilerplate.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/line-endings.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/line-endings.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/metaclass-boilerplate.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/metaclass-boilerplate.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-assert.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-assert.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-basestring.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-basestring.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-dict-iteritems.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-dict-iteritems.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-dict-iterkeys.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-dict-iterkeys.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-dict-itervalues.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-dict-itervalues.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-get-exception.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-get-exception.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-illegal-filenames.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-illegal-filenames.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 # a script to check for illegal filenames on various Operating Systems. The
 # main rules are derived from restrictions on Windows
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-main-display.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-main-display.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-smart-quotes.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-smart-quotes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/lib/ansible_test/_data/sanity/code-smell/no-unicode-literals.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/no-unicode-literals.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/replace-urlopen.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/replace-urlopen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/shebang.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/shebang.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python33
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
@@ -16,14 +16,14 @@
         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 = {
--- a/test/lib/ansible_test/_data/sanity/code-smell/symlinks.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/symlinks.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/use-argspec-type-path.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/use-argspec-type-path.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/use-compat-six.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/use-compat-six.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/compile/compile.py
+++ b/test/lib/ansible_test/_data/sanity/compile/compile.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Python syntax checker with lint friendly output."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/lib/ansible_test/_data/sanity/import/importer.py
+++ b/test/lib/ansible_test/_data/sanity/import/importer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Import the given python module(s) and report error(s) encountered."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/lib/ansible_test/_data/sanity/validate-modules/main.py
+++ b/test/lib/ansible_test/_data/sanity/validate-modules/main.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/yamllint/yamllinter.py
+++ b/test/lib/ansible_test/_data/sanity/yamllint/yamllinter.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Wrapper around yamllint that supports YAML embedded in Ansible modules."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/lib/ansible_test/_data/versions.py
+++ b/test/lib/ansible_test/_data/versions.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Show python and pip versions."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/lib/ansible_test/_data/virtualenvcheck.py
+++ b/test/lib/ansible_test/_data/virtualenvcheck.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Detect the real python interpreter when running in a virtual environment created by the 'virtualenv' module."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/lib/ansible_test/_data/yamlcheck.py
+++ b/test/lib/ansible_test/_data/yamlcheck.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Show python and pip versions."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/sanity/code-smell/configure-remoting-ps1.py
+++ b/test/sanity/code-smell/configure-remoting-ps1.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/sanity/code-smell/deprecated-config.py
+++ b/test/sanity/code-smell/deprecated-config.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 # (c) 2018, Matt Martz <matt@sivel.net>
 #
--- a/test/sanity/code-smell/docs-build.py
+++ b/test/sanity/code-smell/docs-build.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/sanity/code-smell/no-unwanted-files.py
+++ b/test/sanity/code-smell/no-unwanted-files.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Prevent unwanted files from being added to the source tree."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/sanity/code-smell/obsolete-files.py
+++ b/test/sanity/code-smell/obsolete-files.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Prevent files from being added to directories that are now obsolete."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/sanity/code-smell/package-data.py
+++ b/test/sanity/code-smell/package-data.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/sanity/code-smell/required-and-default-attributes.py
+++ b/test/sanity/code-smell/required-and-default-attributes.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/sanity/code-smell/test-constraints.py
+++ b/test/sanity/code-smell/test-constraints.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/sanity/code-smell/update-bundled.py
+++ b/test/sanity/code-smell/update-bundled.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 # (c) 2018, Ansible Project
 #
--- 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)
--- 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
 
 import os
 import pexpect
--- 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
--- 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/
--- a/test/lib/ansible_test/_data/sanity/code-smell/changelog.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/changelog.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
 
--- a/test/lib/ansible_test/_data/sanity/code-smell/runtime-metadata.py
+++ b/test/lib/ansible_test/_data/sanity/code-smell/runtime-metadata.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Schema validation of ansible-base's ansible_builtin_runtime.yml and collection's meta/runtime.yml"""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/lib/ansible_test/_data/sslcheck.py
+++ b/test/lib/ansible_test/_data/sslcheck.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """Show openssl version."""
 from __future__ import (absolute_import, division, print_function)
 __metaclass__ = type
--- a/test/sanity/code-smell/release-names.py
+++ b/test/sanity/code-smell/release-names.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 # (c) 2019, Ansible Project
 #
--- a/test/units/executor/module_common/test_module_common.py
+++ b/test/units/executor/module_common/test_module_common.py
@@ -129,8 +129,8 @@
             (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 python')
 
 
 class TestDetectionRegexes:
--- a/test/integration/targets/blocks/runme.sh
+++ b/test/integration/targets/blocks/runme.sh
@@ -9,7 +9,7 @@
 rm -f block_test.out
 # run the test and check to make sure the right number of completions was logged
 ansible-playbook -vv main.yml -i ../../inventory | tee block_test.out
-env python -c \
+env python3 -c \
     'import sys, re; sys.stdout.write(re.sub("\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
     <block_test.out >block_test_wo_colors.out
 [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
@@ -17,7 +17,7 @@
 rm -f block_test.out block_test_wo_colors.out
 # run test with free strategy and again count the completions
 ansible-playbook -vv main.yml -i ../../inventory -e test_strategy=free | tee block_test.out
-env python -c \
+env python3 -c \
     'import sys, re; sys.stdout.write(re.sub("\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
     <block_test.out >block_test_wo_colors.out
 [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
@@ -25,7 +25,7 @@
 rm -f block_test.out block_test_wo_colors.out
 # run test with host_pinned strategy and again count the completions
 ansible-playbook -vv main.yml -i ../../inventory -e test_strategy=host_pinned | tee block_test.out
-env python -c \
+env python3 -c \
     'import sys, re; sys.stdout.write(re.sub("\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
     <block_test.out >block_test_wo_colors.out
 [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
@@ -33,7 +33,7 @@
 # run test that includes tasks that fail inside a block with always
 rm -f block_test.out block_test_wo_colors.out
 ansible-playbook -vv block_fail.yml -i ../../inventory | tee block_test.out
-env python -c \
+env python3 -c \
     'import sys, re; sys.stdout.write(re.sub("\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
     <block_test.out >block_test_wo_colors.out
 [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
--- a/test/integration/targets/plugin_config_for_inventory/runme.sh
+++ b/test/integration/targets/plugin_config_for_inventory/runme.sh
@@ -7,10 +7,10 @@
 
 # check default values
 ansible-inventory --list -i ./config_without_parameter.yml --export | \
-    env python -c "import json, sys; inv = json.loads(sys.stdin.read()); \
+    env python3 -c "import json, sys; inv = json.loads(sys.stdin.read()); \
                    assert set(inv['_meta']['hostvars']['test_host']['departments']) == set(['seine-et-marne', 'haute-garonne'])"
 
 # check values
 ansible-inventory --list -i ./config_with_parameter.yml --export | \
-    env python -c "import json, sys; inv = json.loads(sys.stdin.read()); \
+    env python3 -c "import json, sys; inv = json.loads(sys.stdin.read()); \
                    assert set(inv['_meta']['hostvars']['test_host']['departments']) == set(['paris'])"
--- a/docs/docsite/Makefile
+++ b/docs/docsite/Makefile
@@ -1,5 +1,5 @@
 OS := $(shell uname -s)
-SITELIB = $(shell python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"):
+SITELIB = $(shell python3 -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"):
 PLUGIN_FORMATTER=../../hacking/build-ansible.py docs-build
 TESTING_FORMATTER=../bin/testing_formatter.sh
 KEYWORD_DUMPER=../../hacking/build-ansible.py document-keywords
@@ -34,7 +34,7 @@
 
 DOC_PLUGINS ?= become cache callback cliconf connection httpapi inventory lookup netconf shell strategy vars
 
-PYTHON=python
+PYTHON=python3
 # fetch version from project release.py as single source-of-truth
 VERSION := $(shell $(PYTHON) ../../packaging/release/versionhelper/version_helper.py --raw || echo error)
 ifeq ($(findstring error,$(VERSION)), error)