From e7b72fa5708688750967f1a09b9ea94f94334341 Mon Sep 17 00:00:00 2001 From: orbisai0security Date: Fri, 24 Jul 2026 22:20:36 +0000 Subject: [PATCH] fix: V-003 security vulnerability Automated security fix generated by OrbisAI Security --- Lib/_osx_support.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py index 29b89e311cb1fe7..21bbc32411cfe54 100644 --- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -68,11 +68,11 @@ def _read_output(commandstring, capture_stderr=False): os.getpid(),), "w+b") with contextlib.closing(fp) as fp: - if capture_stderr: - cmd = "%s >'%s' 2>&1" % (commandstring, fp.name) - else: - cmd = "%s 2>/dev/null >'%s'" % (commandstring, fp.name) - return fp.read().decode('utf-8').strip() if not os.system(cmd) else None + import subprocess + stderr = subprocess.STDOUT if capture_stderr else subprocess.DEVNULL + rc = subprocess.call(commandstring, shell=True, stdout=fp, stderr=stderr) + fp.seek(0) + return fp.read().decode('utf-8').strip() if not rc else None def _find_build_tool(toolname):