Skip to content

Keep runtime type errors free of ANSI escapes - #913

Open
abhinavrastogi2627 wants to merge 1 commit into
spdx:mainfrom
abhinavrastogi2627:fix/plain-type-errors
Open

abhinavrastogi2627 wants to merge 1 commit into
spdx:mainfrom
abhinavrastogi2627:fix/plain-type-errors

Conversation

@abhinavrastogi2627

Copy link
Copy Markdown

Fixes #822.

Disable beartype's automatic terminal coloring for generated property setters. These diagnostics become strings inside ConstructorTypeErrors, where ANSI escapes are shown literally instead of rendered. Direct property-assignment errors now use the same plain-text format. Validation and exception types are unchanged.

Require beartype >=0.12.0 for the explicit color configuration. Regression tests cover constructor and setter failures with terminal detection both on and off; the two terminal cases failed before the fix.

Validation: 1,040 tests passed, 3 skipped (Python 3.12; 3 warnings). The four regression cases also pass with beartype 0.12.0 on Python 3.10. Repository-wide isort, Black and flake8 checks pass.

Fixes spdx#822

Signed-off-by: Abhinav Rastogi <abhinavrastogi9596@gmail.com>
@abhinavrastogi2627

Copy link
Copy Markdown
Author

Ready for review when convenient. The local suite passes (1,040 tests, three skips), including terminal and non-terminal regression coverage. The GitHub test and lint workflows currently require maintainer approval.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type errors are hard to read due to unrendered color codes

1 participant