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
This commit is contained in:
@@ -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,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user