Skip to content

fix(frontend): keep warnings about analysed sources off the analyzer's stderr - #246

Merged
SizzleUnrlsd merged 1 commit into
mainfrom
fix/analysed-source-warnings
Oct 13, 2026
Merged

SizzleUnrlsd merged 1 commit into
mainfrom
fix/analysed-source-warnings

Conversation

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor

Summary

Warnings Python raises while parsing an analysed source were printed on the analyzer's stderr. An invalid escape sequence, for example, is a SyntaxWarning from Python 3.12 and a DeprecationWarning on 3.11. With -j N each warning was printed twice, because the parent and a worker both parse every module.

parse_source is the single parsing entry point for both. It now ignores warnings inside warnings.catch_warnings(), so the warning filters of the rest of the process are left untouched.

Verification

New tests in tests/test_parse_warnings.py, red before the change:

  • parsing raises no warning about the analysed source;
  • parsing leaves the process's warning filters alone;
  • --check with -j 1 and -j 2 prints nothing on stderr, with the expected report and exit status.

No existing test changed.

Results:

  • Python 3.14.5: full suite green, apart from test_packaging.py::test_the_version_has_one_source_of_truth. That test also fails on main, because of locally installed metadata (0.8.0).
  • Python 3.11.13: the new tests pass with the change. Without it, the two parsing tests fail with a DeprecationWarning.
  • Linters: ruff check and mypy clean.
  • Regression suite: not run. The change does not alter any analysis result.

Closes #241

@SizzleUnrlsd SizzleUnrlsd added the bug Something isn't working label Oct 12, 2026
@SizzleUnrlsd SizzleUnrlsd self-assigned this Oct 12, 2026
@SizzleUnrlsd
SizzleUnrlsd merged commit 074d63f into main Oct 13, 2026
10 checks passed
@SizzleUnrlsd
SizzleUnrlsd deleted the fix/analysed-source-warnings branch October 13, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frontend: SyntaxWarning from analysed sources is printed on the analyzer's stderr, twice with -j

1 participant