Feature or enhancement
It is scheduled to be removed in 3.16
Source:
| # When deprecation ends for using the 'strm' parameter, remove the | |
| # "except TypeError ..." | |
| try: | |
| result = factory(**kwargs) | |
| except TypeError as te: | |
| 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) | |
| import warnings | |
| warnings.warn( | |
| "Support for custom logging handlers with the 'strm' argument " | |
| "is deprecated and scheduled for removal in Python 3.16. " | |
| "Define handlers with the 'stream' argument instead.", | |
| DeprecationWarning, | |
| stacklevel=2, | |
| ) |