Feature or enhancement
Refs #115032
Refs #115314
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, |
|
) |
Linked PRs
Feature or enhancement
Refs #115032
Refs #115314
It is scheduled to be removed in 3.16
Source:
cpython/Lib/logging/config.py
Lines 868 to 889 in 46a2c11
Linked PRs
strmargument support fromlogginghandlers #149599