Fix Python 3.6 compatibility in binary verification

Replace capture_output parameter with stdout/stderr PIPE for Python 3.6
compatibility. The capture_output parameter was added in Python 3.7 and
causes errors on AlmaLinux 8 which uses Python 3.6.

Changed subprocess.run() calls to use:
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True
Instead of:
- capture_output=True, text=True
This commit is contained in:
usmannasir
2025-11-09 20:55:00 +05:00
parent 2e8d9d5e8e
commit fb76981ff2

View File

@@ -370,7 +370,7 @@ class InstallCyberPanel:
# Check library dependencies
command = f'ldd {binary_path}'
result = subprocess.run(command, shell=True, capture_output=True, text=True)
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
if result.returncode != 0:
InstallCyberPanel.stdOut("ERROR: Failed to check binary dependencies", 1)
@@ -386,7 +386,7 @@ class InstallCyberPanel:
# Try to run the binary with -v to check if it can execute
command = f'{binary_path} -v'
result = subprocess.run(command, shell=True, capture_output=True, text=True, timeout=5)
result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, timeout=5)
if result.returncode != 0:
InstallCyberPanel.stdOut("ERROR: Binary failed to execute", 1)