Skip to content

Fix 89 - #220

Merged
oberstet merged 2 commits into
crossbario:masterfrom
oberstet:fix_89
Jun 18, 2026
Merged

Fix 89#220
oberstet merged 2 commits into
crossbario:masterfrom
oberstet:fix_89

Conversation

@oberstet

Copy link
Copy Markdown
Contributor

fixes #89

oberstet added 2 commits June 18, 2026 10:16
…rio#89)

On the asyncio backend, _log() did `getattr(logger._logger, level)(msg)`
with level == "warn", which resolves to logging.Logger.warn — the
deprecated alias of .warning — emitting "DeprecationWarning: The 'warn'
method is deprecated, use 'warning' instead".

Remap the "warn" level name to "warning" for stdlib dispatch, mirroring
the existing "trace" -> "debug" handling, while keeping the txaio-facing
level name "warn" in kwargs["log_level"]. The Twisted backend is
unaffected (it maps to LogLevel.warn, not stdlib method names).

Add a cross-backend regression test (test_warn) that turns
DeprecationWarning into an error and asserts the message is emitted.
Verified red before the fix (asyncio) and green after, both backends.

Note: This work was completed with AI assistance (Claude Code).
@oberstet
oberstet merged commit 10b46d7 into crossbario:master Jun 18, 2026
7 checks passed
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.

DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead

1 participant