AOSSIE-Org / AOSSIE-Org/PictoPy

Logging: InterceptHandler preserves exc_info and stack_info (should be cleared before formatting)

Aberta
#708 0 comentários 0 reações 1 responsável Reivindicada por @VasuS609 Ver no GitHub
backend bug
Linguagem predominante
Python
Estrelas
283
Forks
679
Merge médio
7d 2h
PRs com merge (30d)
3

Descrição

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

The InterceptHandler in backend/app/logging/setup_logging.py calls
self.format(record) while record.exc_info and record.stack_info are still set.

Python’s Formatter.format() automatically appends traceback and stack output if
these fields are truthy.

This violates the project rule that exc_info and stack_info should not be
preserved when rerouting logs.

Fix proposal:
record.exc_info = None
record.stack_info = None
msg = self.format(record)

This should be applied around lines 238–252.

### Record

- [x] I agree to follow this project's Code of Conduct

### Checklist before Submitting

- [x] Have you updated docs for it?
- [ ] Have you added unit tests?
- [x] Have you made sure unit tests pass?
- [x] Have you made sure code formatting is correct?
- [x] Do Your changes passes all tests?

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.