Repository navigation
Deprecate old backward compatible shims in configure_formatter()/handler(). #115032
Description
Activity
- addedtype-featureA feature request or enhancementA feature request or enhancement
on Feb 5, 2024 cc @vsajip
Reacted by Mariusz Felisiak- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Feb 7, 2024 I realise Django doesn't use them any more, but what about other code / users? I wouldn't strongly object to removing them, but there's a chance that any such change might need to be reverted if there are complaints that it breaks existing code somewhere. And, of course, no backporting of any such change. Perhaps deprecate, but not remove immediately - rather, in line with the usual deprecation cycle. It's just a little wart in the current code, after all.
Perhaps deprecate, but not remove immediately - rather, in line with the usual deprecation cycle.
Yes that's what I was trying to propose. We have an existing and straightforward upgrade path i.e. use
formatinstead offmtand usestreaminstead ofstrm, so it seems fine to deprecate the current workarounds and remove them in 3.15 (I guess 🤔).It's just a little wart in the current code, after all.
True, but they become an issue when there are dozens of such workarounds ("death by a thousand cuts").
become an issue when there are dozens of such workarounds
Well, it's not that bad IMO, but I'll look at a PR that does deprecation.
Reacted by Mariusz FelisiakWhile preparing a patch, I noticed that we can deprecate
strm, however,fmtis still needed becauseconfigis passed directly to the custom formatters andFormatterexceptfmtinstead offormat.- added a commit that references this issue
on Feb 13, 2024 - added a commit that references this issue
on Apr 27, 2025
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Feature or enhancement
Proposal:
DictConfigurator.configure_formatter()andconfigure_handler()contain workarounds for old configurationscpython/Lib/logging/config.py
Lines 670 to 676 in bcccf1f
cpython/Lib/logging/config.py
Lines 844 to 851 in bcccf1f
Django doesn't use
fmtandstrmfor many years. I think both can be deprecated and removed.I'd like to prepare a patch, if accepted.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
fmtretry. #115303