Content-Length: 311208 | pFad | https://github.com/python/cpython/issues/115032

05 Deprecate old backward compatible shims in configure_formatter()/handler(). · Issue #115032 · python/cpython · GitHub
Skip to content

Deprecate old backward compatible shims in configure_formatter()/handler(). #115032

@felixxm

Description

@felixxm

Feature or enhancement

Proposal:

DictConfigurator.configure_formatter() and configure_handler() contain workarounds for old configurations

#Name of parameter changed from fmt to format.
#Retry with old name.
#This is so that code can be used with older Python versions
#(e.g. by Django)
config['fmt'] = config.pop('format')
config['()'] = factory
result = self.configure_custom(config)

if "'stream'" not in str(te):
raise
#The argument name changed from strm to stream
#Retry with old name.
#This is so that code can be used with older Python versions
#(e.g. by Django)
kwargs['strm'] = kwargs.pop('stream')
result = factory(**kwargs)

Django doesn't use fmt and strm for 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/115032

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy