Open rmartin16 opened 2 hours ago
Managed to boil down an example, fwiw:
import structlog
from pydantic import BaseModel, computed_field
class Model(BaseModel):
a: int
@computed_field
def a_otherwise(self) -> int:
return self.a
def main():
try:
Model(a="")
except Exception as e:
structlog.get_logger().exception("error")
main()
Upgraded from v24.2.0 to v24.4.0 and exception logging started raising its own exceptions. Previously, the
repr-error
text would be used; therefore,rich.pretty.traverse()
is hitting the same error as the previous logic and letting the exception leak. It isn't clear to me if Rich should be catching these or structlog (or if we just shouldn't have a few classes that cause this...) but I think it is unexpected for exception logging to start raising itself.