Skip to content

TypeError when setting ExceptionDictTransformer's constructor arguments locals_max_string and locals_max_length to None #672

@Sh4pe

Description

@Sh4pe

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:

if locals_max_length < 0:
msg = f'"locals_max_length" must be >= 0: {locals_max_length}'
raise ValueError(msg)
if locals_max_string < 0:
msg = f'"locals_max_string" must be >= 0: {locals_max_string}'
raise ValueError(msg)

It should contain logic that handles the None case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions