tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 74bd1f11812b90fd5328153771aca2923ecee7bb
parent 866d02765cd02d18d5ea503bf5afa65ad9137b95
Author: Alex Hochheiden <ahochheiden@mozilla.com>
Date:   Wed, 10 Dec 2025 06:03:24 +0000

Bug 2003412 - PLW warnings auto-fixed by `./mach lint --fix .` r=emilio,taskgraph-reviewers,releng-reviewers,ahal,whimboo

Differential Revision: https://phabricator.services.mozilla.com/D274694

Diffstat:
Mbuild/midl.py | 2+-
Mbuild/win32/dummy_libs.py | 3++-
Mconfig/create_res.py | 4++--
Mconfig/external/icu/data/convert_icudata.py | 3++-
Mconfig/wasm2c.py | 3++-
Mjs/src/irregexp/import-irregexp.py | 2+-
Mmobile/android/fenix/app/src/androidTest/java/org/mozilla/fenix/experimentintegration/generate_smoke_tests.py | 2+-
Mmobile/android/fenix/tools/setup-startup-profiling.py | 11+++++++----
Mpython/mach/mach/test/test_site_compatibility.py | 1+
Mpython/mach_commands.py | 1+
Mpython/mozboot/mozboot/base.py | 1+
Mpython/mozboot/mozboot/bootstrap.py | 6+++++-
Mpython/mozboot/mozboot/centosfedora.py | 1+
Mpython/mozboot/mozboot/debian.py | 5++++-
Mpython/mozboot/mozboot/mach_commands.py | 2+-
Mpython/mozbuild/mozbuild/repackaging/msix.py | 6+++---
Mpython/mozbuild/mozpack/pkg.py | 1+
Mtaskcluster/docker/updatebot/run.py | 2+-
Mtaskcluster/gecko_taskgraph/util/partials.py | 3+--
Mtaskcluster/scripts/tests/copy-artifacts-from-ftl.py | 5++++-
Mtaskcluster/test/test_generate_params.py | 2+-
Mtesting/marionette/harness/marionette_harness/marionette_test/testcases.py | 3+--
Mtesting/mozbase/mozproxy/tests/test_command_line.py | 2+-
Mtoolkit/library/libxul.so-gdb.py | 16++++++++--------
Mtoolkit/modules/subprocess/test/xpcshell/data_test_child.py | 1+
Mtools/phabricator/mach_commands.py | 8++++----
26 files changed, 58 insertions(+), 38 deletions(-)

diff --git a/build/midl.py b/build/midl.py @@ -157,7 +157,7 @@ def midl(out, input, *flags): command.append("-Oicf") command.append(relativize(input, base)) print("Executing:", " ".join(command)) - result = subprocess.run(command, cwd=base) + result = subprocess.run(command, check=False, cwd=base) return result.returncode finally: if tmpdir: diff --git a/build/win32/dummy_libs.py b/build/win32/dummy_libs.py @@ -17,7 +17,8 @@ def main(output, *other_libs): libs.extend(os.path.join(parent, l) for l in other_libs) for lib in libs: result = subprocess.run( - [substs["AR"]] + [f.replace("$@", lib) for f in substs["AR_FLAGS"]] + [substs["AR"]] + [f.replace("$@", lib) for f in substs["AR_FLAGS"]], + check=False, ) if result.returncode != 0: return result.returncode diff --git a/config/create_res.py b/config/create_res.py @@ -61,7 +61,7 @@ def generate_res(): if verbose: print("Executing:", " ".join(command)) with os.fdopen(fd, "wb") as fh: - retcode = subprocess.run(command, stdout=fh).returncode + retcode = subprocess.run(command, check=False, stdout=fh).returncode if retcode: # Rely on the subprocess printing out any relevant error return retcode @@ -87,7 +87,7 @@ def generate_res(): if verbose: print("Executing:", " ".join(command)) - retcode = subprocess.run(command).returncode + retcode = subprocess.run(command, check=False).returncode if retcode: # Rely on the subprocess printing out any relevant error return retcode diff --git a/config/external/icu/data/convert_icudata.py b/config/external/icu/data/convert_icudata.py @@ -16,5 +16,6 @@ def main(output, data_file): "-tb", data_file, output.name, - ] + ], + check=False, ) diff --git a/config/wasm2c.py b/config/wasm2c.py @@ -10,5 +10,6 @@ def wasm2c(output, wasm2c_bin, wasm_lib, *flags): output.close() module_name = os.path.basename(os.path.splitext(wasm_lib)[0]) return subprocess.run( - [wasm2c_bin, "-n", module_name] + list(flags) + ["-o", output.name, wasm_lib] + [wasm2c_bin, "-n", module_name] + list(flags) + ["-o", output.name, wasm_lib], + check=False, ).returncode diff --git a/js/src/irregexp/import-irregexp.py b/js/src/irregexp/import-irregexp.py @@ -126,7 +126,7 @@ if __name__ == "__main__": provided_path = "the command-line" elif "TASK_ID" in os.environ: src_path = Path("/builds/worker/v8/") - subprocess.run("git pull origin master", shell=True, cwd=src_path) + subprocess.run("git pull origin master", check=False, shell=True, cwd=src_path) src_path = Path("/builds/worker/v8/src/regexp") provided_path = "the hardcoded path in the taskcluster image" diff --git a/mobile/android/fenix/app/src/androidTest/java/org/mozilla/fenix/experimentintegration/generate_smoke_tests.py b/mobile/android/fenix/app/src/androidTest/java/org/mozilla/fenix/experimentintegration/generate_smoke_tests.py @@ -57,7 +57,7 @@ def create_test_file(): print("File Exists, you need to delete it to create a new one.") return # file exists - subprocess.run([f"touch {final_path}"], encoding="utf8", shell=True) + subprocess.run([f"touch {final_path}"], check=False, encoding="utf8", shell=True) assert final_path.exists() with open(final_path, "w") as file: file.write("import pytest\n\n") diff --git a/mobile/android/fenix/tools/setup-startup-profiling.py b/mobile/android/fenix/tools/setup-startup-profiling.py @@ -73,8 +73,11 @@ def push(id, filename): f.write(GV_CONFIG) print(f"Pushing {filename} to device.") - run(["adb", "push", config.name, os.path.join(PATH_PREFIX, filename)]) - run(["adb", "shell", "am", "set-debug-app", "--persistent", id]) + run( + ["adb", "push", config.name, os.path.join(PATH_PREFIX, filename)], + check=False, + ) + run(["adb", "shell", "am", "set-debug-app", "--persistent", id], check=False) print( "\nStartup profiling enabled on all future start ups, possibly even after reinstall." ) @@ -90,8 +93,8 @@ def push(id, filename): def remove(filename): print(f"Removing {filename} from device.") - run(["adb", "shell", "rm", PATH_PREFIX + "/" + filename]) - run(["adb", "shell", "am", "clear-debug-app"]) + run(["adb", "shell", "rm", PATH_PREFIX + "/" + filename], check=False) + run(["adb", "shell", "am", "clear-debug-app"], check=False) def convert_channel_to_id(product, channel): diff --git a/python/mach/mach/test/test_site_compatibility.py b/python/mach/mach/test/test_site_compatibility.py @@ -11,6 +11,7 @@ from buildconfig import topsrcdir def test_sites_compatible(tmpdir: str): result = subprocess.run( [sys.executable, "mach", "generate-python-lockfiles"], + check=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=topsrcdir, diff --git a/python/mach_commands.py b/python/mach_commands.py @@ -327,6 +327,7 @@ def _run_python_test(command_context, test, jobs, verbose): result = subprocess.run( cmd, + check=False, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/python/mozboot/mozboot/base.py b/python/mozboot/mozboot/base.py @@ -438,6 +438,7 @@ class BaseBootstrapper: process = subprocess.run( [str(path), version_param], + check=False, env=env, text=True, stdout=subprocess.PIPE, diff --git a/python/mozboot/mozboot/bootstrap.py b/python/mozboot/mozboot/bootstrap.py @@ -172,7 +172,10 @@ def check_for_hgrc_state_dir_mismatch(state_dir): import subprocess result = subprocess.run( - ["hg", "config", "--source", "-T", "json"], capture_output=True, text=True + ["hg", "config", "--source", "-T", "json"], + check=False, + capture_output=True, + text=True, ) if result.returncode: @@ -779,6 +782,7 @@ def _warn_if_risky_revision(path: Path): def _macos_is_running_under_rosetta(): proc = subprocess.run( ["sysctl", "-n", "sysctl.proc_translated"], + check=False, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, ) diff --git a/python/mozboot/mozboot/centosfedora.py b/python/mozboot/mozboot/centosfedora.py @@ -42,6 +42,7 @@ class CentOSFedoraBootstrapper(LinuxBootstrapper, BaseBootstrapper): # https://bugzilla.redhat.com/show_bug.cgi?id=2030255 is_installed = subprocess.run( ["dnf", "list", "--installed", package], + check=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ) diff --git a/python/mozboot/mozboot/debian.py b/python/mozboot/mozboot/debian.py @@ -65,7 +65,10 @@ class DebianBootstrapper(LinuxBootstrapper, BaseBootstrapper): command.extend(packages) return ( subprocess.run( - command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL + command, + check=False, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, ).returncode == 0 ) diff --git a/python/mozboot/mozboot/mach_commands.py b/python/mozboot/mozboot/mach_commands.py @@ -93,7 +93,7 @@ def vcs_setup(command_context, update_only=False, vcs=None): print("Initializing a git colocated jj repository...") jj_bin = get_tool_path("jj") - subprocess.run([jj_bin, "git", "init", "--colocate"]) + subprocess.run([jj_bin, "git", "init", "--colocate"], check=False) if vcs: repo = get_specific_repository_object(topsrcdir, vcs) diff --git a/python/mozbuild/mozbuild/repackaging/msix.py b/python/mozbuild/mozbuild/repackaging/msix.py @@ -986,9 +986,9 @@ def _sign_msix_posix(output, force, log, verbose): if not openssl: raise ValueError("openssl is required; " "set OPENSSL or PATH") - if "sign" not in subprocess.run(makeappx, capture_output=True).stdout.decode( - "utf-8" - ): + if "sign" not in subprocess.run( + makeappx, check=False, capture_output=True + ).stdout.decode("utf-8"): raise ValueError( "makeappx must support 'sign' operation. ", "You probably need to build Mozilla's version of it: ", diff --git a/python/mozbuild/mozpack/pkg.py b/python/mozbuild/mozpack/pkg.py @@ -104,6 +104,7 @@ def create_payload(destination: Path, root_path: Path, cpio_tool: str): "--owner", "0:80", # clean ownership ], + check=False, stdout=tmp_payload, stderr=subprocess.PIPE, input="\n".join(file_list) + "\n", diff --git a/taskcluster/docker/updatebot/run.py b/taskcluster/docker/updatebot/run.py @@ -104,7 +104,7 @@ if OPERATING_MODE == "dev": log("Performing git repo update...") command = ["git", "symbolic-ref", "-q", "HEAD"] - r = subprocess.run(command) + r = subprocess.run(command, check=False) if r.returncode == 0: # This indicates we are on a branch, and not a specific revision subprocess.check_call(["git", "pull", "origin"]) diff --git a/taskcluster/gecko_taskgraph/util/partials.py b/taskcluster/gecko_taskgraph/util/partials.py @@ -126,8 +126,7 @@ def _retry_on_http_errors(url, verify, params, errors): ) else: raise - else: - raise Exception(f"Cannot connect to {url}!") + raise Exception(f"Cannot connect to {url}!") def get_sorted_releases(product, branch): diff --git a/taskcluster/scripts/tests/copy-artifacts-from-ftl.py b/taskcluster/scripts/tests/copy-artifacts-from-ftl.py @@ -189,7 +189,10 @@ def gsutil_cp(artifact, dest): logging.info(f"Copying {artifact} to {dest}") try: result = subprocess.run( - ["gsutil", "cp", artifact, dest], capture_output=True, text=True + ["gsutil", "cp", artifact, dest], + check=False, + capture_output=True, + text=True, ) if result.returncode != 0: if "AccessDeniedException" in result.stderr: diff --git a/taskcluster/test/test_generate_params.py b/taskcluster/test/test_generate_params.py @@ -29,7 +29,7 @@ def get_graph_from_spec(tmpdir_factory): # entirely as having already run env = os.environ.copy() env.pop("MOZ_AUTOMATION", None) - subprocess.run(cmd, cwd=GECKO, env=env) + subprocess.run(cmd, check=False, cwd=GECKO, env=env) assert len(outdir.listdir()) > 0 def inner(param_spec): diff --git a/testing/marionette/harness/marionette_harness/marionette_test/testcases.py b/testing/marionette/harness/marionette_harness/marionette_test/testcases.py @@ -409,5 +409,4 @@ class MarionetteTestCase(CommonTestCase): if value: return value time.sleep(0.5) - else: - raise TimeoutException("wait_for_condition timed out") + raise TimeoutException("wait_for_condition timed out") diff --git a/testing/mozbase/mozproxy/tests/test_command_line.py b/testing/mozbase/mozproxy/tests/test_command_line.py @@ -84,7 +84,7 @@ class OutputHandler: def test_help(): - p = subprocess.run([sys.executable, "-m", "mozproxy", "--help"]) + p = subprocess.run([sys.executable, "-m", "mozproxy", "--help"], check=False) assert p.returncode == 0 diff --git a/toolkit/library/libxul.so-gdb.py b/toolkit/library/libxul.so-gdb.py @@ -19,18 +19,18 @@ from os.path import abspath, dirname, exists libxul_dir = dirname(__file__) objdir = None for relpath in ("../../..", "../.."): - objdir = abspath(libxul_dir + "/" + relpath) - if not exists(objdir + "/build/.gdbinit"): + candidate = abspath(libxul_dir + "/" + relpath) + if not exists(candidate + "/build/.gdbinit"): continue - if objdir is not None: - m = re.search(r"[\w ]+: (.*)", gdb.execute("show directories", False, True)) - if m and (objdir not in m.group(1).split(":")): - gdb.execute(f"set directories {objdir}:{m.group(1)}") -else: - gdb.write("Warning: Gecko objdir not found\n") + objdir = candidate + m = re.search(r"[\w ]+: (.*)", gdb.execute("show directories", False, True)) + if m and (objdir not in m.group(1).split(":")): + gdb.execute(f"set directories {objdir}:{m.group(1)}") if objdir is not None: # When running from a random directory, the toplevel Gecko .gdbinit may # not have been loaded. Load it now. gdb.execute("source -s build/.gdbinit.loader") +else: + gdb.write("Warning: Gecko objdir not found\n") diff --git a/toolkit/modules/subprocess/test/xpcshell/data_test_child.py b/toolkit/modules/subprocess/test/xpcshell/data_test_child.py @@ -43,6 +43,7 @@ def spawn_child_and_exit(is_breakaway_job): # mistakenly detect an exited child process for the parent process). subprocess.run( [sys.executable, "-c", "print('2. first_child_start_and_exit')"], + check=False, stdout=sys.stdout, stderr=sys.stderr, ) diff --git a/tools/phabricator/mach_commands.py b/tools/phabricator/mach_commands.py @@ -41,7 +41,7 @@ def install_moz_phab(command_context, force=False): if force: cmd.append("--force") - result = subprocess.run(cmd) + result = subprocess.run(cmd, check=False) if result.returncode != 0: command_context.log( @@ -55,7 +55,7 @@ def install_moz_phab(command_context, force=False): # `uv tool update-shell` adds `moz-phab` to PATH but that requires a terminal restart. # We need the executable path now to add the API token, so we locate it via uv tool_dir_result = subprocess.run( - ["uv", "tool", "dir", "--bin"], capture_output=True, text=True + ["uv", "tool", "dir", "--bin"], check=False, capture_output=True, text=True ) if tool_dir_result.returncode == 0: @@ -65,7 +65,7 @@ def install_moz_phab(command_context, force=False): if not moz_phab_path.exists(): moz_phab_path = moz_phab_path.with_suffix(".exe") - subprocess.run([moz_phab_path, "install-certificate"]) + subprocess.run([moz_phab_path, "install-certificate"], check=False) else: command_context.log( logging.WARNING, @@ -75,4 +75,4 @@ def install_moz_phab(command_context, force=False): ) # We run this last, since it instructs the user to restart their shell (if necessary) - subprocess.run(["uv", "tool", "update-shell"]) + subprocess.run(["uv", "tool", "update-shell"], check=False)