hynek / structlog

Simple, powerful, and fast logging for Python.
https://www.structlog.org/
Other
3.6k stars 225 forks source link

Exception #671

Closed Sh4pe closed 2 weeks ago

Sh4pe commented 2 weeks ago

As of version 24.3.0 (see #627), ExceptionDictTransformer interprets the constructor arguments locals_max_string and locals_max_length as type int | None where None supposedly disables abbreviation or truncation. However, if you set one of those to None, you get a TypeError:

TypeError: '<' not supported between instances of 'NoneType' and 'int'

This is because of the following snippet:

https://github.com/hynek/structlog/blob/51641b764085c1b907a9b57857c1e71b2810a70e/src/structlog/tracebacks.py#L385-L390

It should contain logic that handles the None case.

Sh4pe commented 2 weeks ago

Huh, it appears I've opened this issue twice. I'll close this one.