Migrate python invocations to python3 (#87759)
Python 2 has been end-of-life'd since January 2020, all Python scripts
on which Flutter depends have been migrated to Python 3. This changes
documentation and remaining invocations to explicitly invoke python3.
Issue: https://github.com/flutter/flutter/issues/83043
diff --git a/dev/bots/README.md b/dev/bots/README.md
index 37a5665..59ebf6d 100644
--- a/dev/bots/README.md
+++ b/dev/bots/README.md
@@ -47,7 +47,7 @@
- Make sure the `depot_tools` is in your `PATH`. If you're on Windows, you also need
an environment variable called `DEPOT_TOOLS` with the path to `depot_tools` as value.
-- Run `gsutil.py config` (or `python %DEPOT_TOOLS%\gsutil.py` on Windows) to
+- Run `gsutil.py config` (or `python3 %DEPOT_TOOLS%\gsutil.py` on Windows) to
authenticate with your auth token.
- Create a local temp directory. `cd` into it.
- Run `dart [path to your normal Flutter repo]/dev/bots/prepare_package.dart
diff --git a/dev/bots/prepare_package.dart b/dev/bots/prepare_package.dart
index e3f3e5c..df57ea6 100644
--- a/dev/bots/prepare_package.dart
+++ b/dev/bots/prepare_package.dart
@@ -669,7 +669,7 @@
}
if (platform.isWindows) {
return _processRunner.runProcess(
- <String>['python', path.join(platform.environment['DEPOT_TOOLS']!, 'gsutil.py'), '--', ...args],
+ <String>['python3', path.join(platform.environment['DEPOT_TOOLS']!, 'gsutil.py'), '--', ...args],
workingDirectory: workingDirectory,
failOk: failOk,
);
diff --git a/dev/bots/test/prepare_package_test.dart b/dev/bots/test/prepare_package_test.dart
index d88d553..a6f9f55 100644
--- a/dev/bots/test/prepare_package_test.dart
+++ b/dev/bots/test/prepare_package_test.dart
@@ -289,7 +289,7 @@
late FakeProcessManager processManager;
late Directory tempDir;
final String gsutilCall = platform.isWindows
- ? 'python ${path.join("D:", "depot_tools", "gsutil.py")}'
+ ? 'python3 ${path.join("D:", "depot_tools", "gsutil.py")}'
: 'gsutil.py';
final String releasesName = 'releases_$platformName.json';
final String archiveName = platform.isLinux ? 'archive.tar.xz' : 'archive.zip';