pw_presubmit: Separate 'bazel info' stderr

Separate stdout and stderr of 'bazel info output_base'.

Bug: b/332357274
Change-Id: Iab1c35d3e01e9331013bf3248e65a4bb5d1fefe4
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/206350
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Kayce Basques <kayce@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/pw_presubmit/py/pw_presubmit/build.py b/pw_presubmit/py/pw_presubmit/build.py
index a4696d9..c2ecce0 100644
--- a/pw_presubmit/py/pw_presubmit/build.py
+++ b/pw_presubmit/py/pw_presubmit/build.py
@@ -106,8 +106,10 @@
                     (ctx.output_dir / f'bazel.{cmd}.stdout').open('w')
                 )
 
-            with (ctx.output_dir / 'bazel.output.base').open('w') as outs:
-                call('bazel', 'info', 'output_base', tee=outs)
+            with (ctx.output_dir / 'bazel.output.base').open('w') as outs, (
+                ctx.output_dir / 'bazel.output.base.err'
+            ).open('w') as errs:
+                call('bazel', 'info', 'output_base', tee=outs, stderr=errs)
 
             call(
                 'bazel',
diff --git a/pw_presubmit/py/pw_presubmit/presubmit.py b/pw_presubmit/py/pw_presubmit/presubmit.py
index 70727b3..9501312 100644
--- a/pw_presubmit/py/pw_presubmit/presubmit.py
+++ b/pw_presubmit/py/pw_presubmit/presubmit.py
@@ -1094,8 +1094,8 @@
     propagate_sigterm = kwargs.pop('propagate_sigterm', False)
 
     env = pw_cli.env.pigweed_environment()
-    kwargs['stdout'] = subprocess.PIPE
-    kwargs['stderr'] = subprocess.STDOUT
+    kwargs.setdefault('stdout', subprocess.PIPE)
+    kwargs.setdefault('stderr', subprocess.STDOUT)
 
     process = subprocess.Popen(args, **kwargs)
     assert process.stdout