fix: corregir bugs silenciosos, malas prácticas y convenciones de logging#6
Draft
fix: corregir bugs silenciosos, malas prácticas y convenciones de logging#6
Conversation
…ging Agent-Logs-Url: https://github.com/ElPoot/contabilidad/sessions/10a1320a-86c5-474f-a8d6-c86894e9ee83 Co-authored-by: ElPoot <195249313+ElPoot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ElPoot/contabilidad/sessions/10a1320a-86c5-474f-a8d6-c86894e9ee83 Co-authored-by: ElPoot <195249313+ElPoot@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate code repository for bad practices and silent failures
fix: corregir bugs silenciosos, malas prácticas y convenciones de logging
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auditoría técnica del repositorio en busca de bugs reales, fallas silenciosas, código duplicado y convenciones inconsistentes. Se corrigen 16 problemas en 11 archivos.
Bugs reales
Path(None)crash enrecover_orphaned_pdf:orphaned_info.get("archivo")puede serNone;Path(None)lanzaTypeErrorque quedaba tragado por elexcept Exceptionexterior. Ahora se validaclaveyarchivoantes de construir elPath.classifier.py: el mensaje de error mostraba literalmente{attempt + 1}en vez del número real de intentos.stren vez dePathpasado aheal_classified_pathenclassification_utils.py.sum_decimal_strings:xml_managerretornaba""para input vacío;iva_utilsretorna"0". Unificado a"0".Fallas silenciosas
Múltiples bloques
except: passsin ningún log convertidos alogger.debug/warning:Adicionalmente,
recover_orphaned_pdfahora re-lanza el error original desafe_move_filecon contexto en vez de descartarlo y lanzar unRuntimeErrorgenérico.Logging
recover_orphaned_pdfusabalogging.*(root logger) en vez delloggerdel módulo.logger.*reemplazadas por formato%lazy enclassifier.pyypdf_cache.py.LOGGER(mayúsculas) renombrado aloggerenxml_manager.py,cabys_manager.py,corte_engine.py,corte_excel.pypara consistencia con el resto del proyecto.Nombres y duplicación
razon_omisión(atributo con acento Unicode enFacturaRecord) renombrado arazon_omision— consistente con el resto de campos del modelo y sin riesgo con herramientas de análisis estático._pdv_globalenfactura_index.pyeliminado; ahora importaparse_decimal_valuedirectamente._sha256definida inline enconsolidate_duplicate_client_folderseliminada; usasha256_fileimportada declassifier.py.