--- thunderbird-115.15.0/python/mozbuild/mozbuild/action/node.py	2024-09-03 17:44:48.000000000 -0700
+++ thunderbird-140.2.1/python/mozbuild/mozbuild/action/node.py	2025-08-28 11:21:29.000000000 -0700
@@ -2,12 +2,13 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-import pipes
+import os
 import subprocess
 import sys
 
 import buildconfig
-import six
+
+from mozbuild.shellutil import quote as shell_quote
 
 SCRIPT_ALLOWLIST = [buildconfig.topsrcdir + "/devtools/client/shared/build/build.js"]
 
@@ -47,9 +48,9 @@
     """
 
     try:
-        printable_cmd = " ".join(pipes.quote(arg) for arg in node_cmd_list)
-        print('Executing "{}"'.format(printable_cmd), file=sys.stderr)
-        sys.stderr.flush()
+        if os.environ.get("BUILD_VERBOSE_LOG"):
+            print(f'Executing "{shell_quote(*node_cmd_list)}"', file=sys.stderr)
+            sys.stderr.flush()
 
         # We need to redirect stderr to a pipe because
         # https://github.com/nodejs/node/issues/14752 causes issues with make.
@@ -71,7 +72,7 @@
         # (intentionally or inadvertently) remove deps.  Do we want this?
         deps = []
         for line in stdout.splitlines():
-            line = six.ensure_text(line)
+            line = line.decode()
             if "dep:" in line:
                 deps.append(line.replace("dep:", ""))
             else:
@@ -119,8 +120,7 @@
         )
         sys.exit(1)
 
-    node_script = six.ensure_text(node_script)
-    if not isinstance(node_script, six.text_type):
+    if not isinstance(node_script, str):
         print(
             "moz.build file didn't pass a valid node script name to execute",
             file=sys.stderr,
