Stefan Scherfke
Stefan Scherfke
Hi @JohnVillalovos , sorry for the late reply. Tried to reproduce the problem with your fixes applied and could not reproduce it. So I think this should work. Thank you...
`rich` should only be used for generating a nicer repr when it is actually available. There shouldn't be any errors caused by `rich` not being installed. I'll take a look...
This looks like #678 – Rich does not handle exceptions raised during traceback rendering. This applies to the ConsoleRenderer as well. Something like this might be a fix: ```diff diff...
Yes, similar to the `safe_str()` function: https://github.com/hynek/structlog/blob/main/src/structlog/tracebacks.py#L104-L109
The custom `to_repr` hook that is used when Rich is not available already has a similar safeguard, but it is not used in case Rich is used (and fails): https://github.com/hynek/structlog/blob/main/src/structlog/tracebacks.py#L169
Looked at the code again. I think that we can fix this relatively easy for the dict transformer (for json logging). But fixing it for the console renderer is not...
Tried to write a regression test for this and realized that rich already has a safe guard for erroneous `__repr__()` implementations. And the actual error occurs when rich traverses the...
Are you using `structlog.processors.dict_tracebacks()`? This is just a shortcut for `ExceptionRenderer(ExceptionDictTransformer())` which has a `show_locals` argument. If secrets are wrapped with `pydantic.Secret()` or `typed_settings.Secret()`, they will not leak. But I...