Skip to content

Correct InvalidLogLevelError docs for the invalid level value - #12704

Closed
Devil1716 wants to merge 1 commit into
twisted:trunkfrom
Devil1716:fix/invalid-log-level-error-docs
Closed

Devil1716 wants to merge 1 commit into
twisted:trunkfrom
Devil1716:fix/invalid-log-level-error-docs

Conversation

@Devil1716

Copy link
Copy Markdown

Summary

  • Document that InvalidLogLevelError.level is the invalid input value (usually a string name), not a LogLevel constant.
  • Align the __init__ type annotation with actual usage (levelWithName raises with the unresolved name).

Test plan

  • Docs-only change; existing twisted.logger tests unchanged

Fixes #9587

The exception is raised when a name cannot be resolved to a LogLevel,
so `level` is the invalid input (typically a str), not a LogLevel
constant. Update the class and `__init__` docs/types to match.

Fixes: ticket:9587
Co-authored-by: Cursor <cursoragent@cursor.com>
@codspeed

codspeed Bot commented Jul 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 36 untouched benchmarks


Comparing Devil1716:fix/invalid-log-level-error-docs (723b030) with trunk (03abe0f)

Open in CodSpeed

@gudnimg

gudnimg commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Besides missing newsfragment, no AI patches are allowed. See policy which is being worked on #12687 its not merged yet.

I’m not familiar with Cursor, but am assuming its some sort of a coding agent like Codex.

@glyph glyph closed this Jul 18, 2026
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.

Incorrect documentation in twisted.logger.Levels class InvalidLogLevelError

3 participants