subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: import subprocess cmd = f'libreoffice --headless --convert-to pdf "{input_path}" --outdir "{os.path.dirname(output_path)}"' result = subprocess.run(cmd, shell=True, capture_output=True, text=True) if result.returncode == 0: logger.info(f"Word转PDF成功: {output_path}") return True- Confidence
- 99% confidence
- Finding
- result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
