What problem does it solve?
This skill helps detect issues in the PDF viewer lifecycle where PyMuPDF/fitz may keep file handles open, mishandle OneDrive placeholders, or cause rendering/text-selection failures that can later block file classification workflows.
Core Features & Use Cases
- File-handle lifecycle auditing: Verifies that
fitz.open() is paired with explicit/guaranteed close() (including try/finally or context-managed patterns) and that handles are released before downstream classification.
- Placeholder detection for OneDrive paths: Checks whether placeholder files (e.g., zero-byte stubs) are detected and safely handled to avoid crashes or incorrect processing.
- Rendering and text extraction checks: Reviews zoom/pixmap rendering and text/word extraction code paths that support selection in the viewer.
- Use case: When PDFs are heavy or sometimes “don’t load,” run this audit to pinpoint where rendering or handle release breaks, especially around transitions that lead to
PermissionError/locked-file behavior.
Quick Start
Ask the auditor to review the current code for gestor_contable/gui/pdf_viewer.py and gestor_contable/config.py and produce the “AUDITORIA: VISOR PDF” report with any real findings only.