tools-python
tools-python copied to clipboard
Type errors are hard to read due to unrendered color codes
The error messages produced by failing type checks are very hard to read as they contain coloring commands which seem not be rendered correctly and might not even make sense for writing them into log files:
[...]
spdx_tools.common.typing.constructor_type_errors.ConstructorTypeErrors: ["SetterError Package: Method\x1b[1m\x1b[35m spdx_tools.common.typing.dataclass_with_properties.make_setter.set_field()\x1b[0m parameter \x1b[1m\x1b[34mattribution_texts\x1b[0m=\x1b[1m\x1b[31m''\x1b[0m violates type hint \x1b[1m\x1b[32mlist[str]\x1b[0m, as \x1b[1m\x1b[33mstr \x1b[0m\x1b[1m\x1b[31m''\x1b[0m not instance of \x1b[1m\x1b[32mlist\x1b[0m.: "]