fix(ocr): address code review - add subprocess security comment and type hints in tests

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-24 13:22:39 +00:00
parent fec032643b
commit 50573ec7be
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -115,6 +115,9 @@ def embed_text_layer(input_pdf_path: str, output_pdf_path: str, *, language: str
logger.info(f"[embed_text_layer] Running: {' '.join(cmd)}")
# Security note: shell=False (the default) is used so no shell interpolation occurs.
# ocrmypdf_bin is resolved via shutil.which() (trusted system PATH).
# input_pdf_path / final_output are internal workdir paths, not raw user input.
try:
proc = subprocess.run(cmd, capture_output=True, text=True, timeout=600, check=False) # noqa: S603
except subprocess.TimeoutExpired: