From 7dec570ce6ae40b934ad075bc06f4cf1dfd9ff2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 00:11:04 +0000 Subject: [PATCH] fix(tasks): add -- end-of-options separator to ocrmypdf command in convert_to_pdfa The test_successful_conversion test asserts that '--' precedes the input/output file paths in the ocrmypdf command as a security measure against argument injection (file paths starting with '-' being interpreted as options). The implementation was missing this separator, causing the test to fail and triggering a downstream pytest INTERNALERROR (OSError: Bad file descriptor) when pytest's terminal writer tried to report the failure. Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/DocuElevate/sessions/bd7ef195-4b30-456e-8118-5c200fb4bf45 --- app/tasks/convert_to_pdfa.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/tasks/convert_to_pdfa.py b/app/tasks/convert_to_pdfa.py index b94ae74a..185b3f8f 100644 --- a/app/tasks/convert_to_pdfa.py +++ b/app/tasks/convert_to_pdfa.py @@ -78,6 +78,7 @@ def _convert_pdf_to_pdfa(input_path: str, output_path: str, pdfa_format: str = " output_type, "--quiet", "--invalidate-digital-signatures", + "--", # end-of-options separator: prevents file paths from being interpreted as options input_path, output_path, ]