Subject: PR Review Request: Fix silent failure when no OCR engine is available (#486)
Hi ,
I have submitted a Pull Request on GitHub (PR #486) to fix an issue where parse_document() silently returns empty output when no OCR engine is installed, and fails to raise the documented ValueError when force_ocr=True.
Summary of changes in the PR:
-
Guarded against the original
use_ocrparameter instead of the overwrittendocument.use_ocrso warnings andValueErrorwork as expected. -
Fixed the
INFO_MESSAGESbuffer cleanup by addingseek(0)beforetruncate(). -
Added 4 regression tests in
tests/test_ocr_engine_missing.py.
Whenever you have a moment, I would really appreciate it if you could review the PR and let me know if you have any feedback or suggestions for improvement.
Thank you for your time and help!