Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue33802

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Regression in logging configuration
Type:behaviorStage:resolved
Components:Versions:Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: barryNosy List: Steap, barry, kevans, koubaa, lukasz.langa, miss-islington, ned.deily, rhettinger, vinay.sajip
Priority:release blockerKeywords:3.7regression, patch

Created on2018-06-07 23:00 bybarry, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
badconfig.pybarry,2018-06-07 23:00
Pull Requests
URLStatusLinkedEdit
PR 7509closedbarry,2018-06-08 00:45
PR 7524mergedlukasz.langa,2018-06-08 09:19
PR 7529mergedmiss-islington,2018-06-08 11:04
PR 21994rhettinger,2020-08-29 16:34
PR 21986koubaa,2020-09-07 15:38
PR 22205adelfino,2020-09-15 20:22
PR 22651kevans,2020-10-11 20:42
Messages (7)
msg318980 -(view)Author: Barry A. Warsaw (barry)*(Python committer)Date: 2018-06-07 23:00
This looks like a serious regression in 3.7.  @ned.deily - I'm marking this as a release blocker, but feel free of course to downgrade it.Run the following as$ python3.6 badconfig.pyHey, it works!$ python3.7 badconfig.pyTraceback (most recent call last):  File "../badconfig.py", line 77, in <module>    fileConfig(inifile.name, defaults=GUNICORN_DEFAULTS)  File "/Users/barry/projects/python/cpython/Lib/logging/config.py", line 65, in fileConfig    cp = configparser.ConfigParser(defaults)  File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 639, in __init__    self._read_defaults(defaults)  File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 1212, in _read_defaults    self.read_dict({self.default_section: defaults})  File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 754, in read_dict    self.set(section, key, value)  File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 1200, in set    super().set(section, option, value)  File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 895, in set    value)  File "/Users/barry/projects/python/cpython/Lib/configparser.py", line 403, in before_set    "position %d" % (value, tmp_value.find('%')))ValueError: invalid interpolation syntax in "{'generic': {'format': '%(asctime)s [%(process)d] [%(levelname)s] %(message)s', 'datefmt': '[%Y-%m-%d %H:%M:%S %z]', 'class': 'logging.Formatter'}}" at position 26I'm still investigating, but wanted to get the bug filed asap.
msg318984 -(view)Author: Barry A. Warsaw (barry)*(Python committer)Date: 2018-06-07 23:22
I think the regression is caused by the fix forbpo-23835https://bugs.python.org/issue23835
msg319037 -(view)Author: Łukasz Langa (lukasz.langa)*(Python committer)Date: 2018-06-08 09:22
I'm very sorry for the trouble! And impressed at Barry's quick diagnosis.
msg319046 -(view)Author: Łukasz Langa (lukasz.langa)*(Python committer)Date: 2018-06-08 11:02
New changeset214f18e49feb6a9d6c05aa09a4bb304905e81334 by Łukasz Langa in branch 'master':bpo-33802: Do not interpolate in ConfigParser while reading defaults (GH-7524)https://github.com/python/cpython/commit/214f18e49feb6a9d6c05aa09a4bb304905e81334
msg319065 -(view)Author: miss-islington (miss-islington)Date: 2018-06-08 14:01
New changesetf44203d782e397941c17d96e6a1f9dc1df08b3e6 by Miss Islington (bot) in branch '3.7':bpo-33802: Do not interpolate in ConfigParser while reading defaults (GH-7524)https://github.com/python/cpython/commit/f44203d782e397941c17d96e6a1f9dc1df08b3e6
msg323213 -(view)Author: Steap (Steap)Date: 2018-08-06 15:39
It seems like this regression has not completely been fixed: there are still issues with "None":$ python3.6 -c 'import configparser; configparser.ConfigParser(defaults={"a": None})'$ python3.7 -c 'import configparser; configparser.ConfigParser(defaults={"a": 1})'$ python3.7 -c 'import configparser; configparser.ConfigParser(defaults={"a": None})'Traceback (most recent call last):  File "<string>", line 1, in <module>  File "/usr/lib/python3.7/configparser.py", line 638, in __init__    self._read_defaults(defaults)  File "/usr/lib/python3.7/configparser.py", line 1216, in _read_defaults    self.read_dict({self.default_section: defaults})  File "/usr/lib/python3.7/configparser.py", line 753, in read_dict    self.set(section, key, value)  File "/usr/lib/python3.7/configparser.py", line 1197, in set    self._validate_value_types(option=option, value=value)  File "/usr/lib/python3.7/configparser.py", line 1182, in _validate_value_types    raise TypeError("option values must be strings")TypeError: option values must be stringsShould "None" not be used, or should this bug be reopened?
msg323291 -(view)Author: Łukasz Langa (lukasz.langa)*(Python committer)Date: 2018-08-08 15:14
None is an invalid value in the configparser. It only accepts strings. See:>>> cp = ConfigParser()>>> cp['asd'] = {'a': None}Traceback (most recent call last):...TypeError: option values must be stringsThe DEFAULT section was an omission which is now fixed. You can use a RawConfigParser if you want to put invalid types as option values:>>> rcp = RawConfigParser()>>> rcp['asd'] = {'a': None}>>>
History
DateUserActionArgs
2022-04-11 14:59:01adminsetgithub: 77983
2020-10-11 20:42:06kevanssetnosy: +kevans

pull_requests: +pull_request21629
2020-10-03 13:38:41adelfinosetnosy: -adelfino
2020-10-03 07:09:33scodersetnosy: -scoder
2020-10-03 07:09:21scodersetpull_requests: -pull_request21521
2020-10-03 06:56:08scodersetnosy: +scoder

pull_requests: +pull_request21521
2020-09-15 20:22:21adelfinosetnosy: +adelfino

pull_requests: +pull_request21317
2020-09-07 15:38:07koubaasetnosy: +koubaa

pull_requests: +pull_request21220
2020-09-07 07:38:17kulikjaksetnosy: -kulikjak
2020-09-07 07:38:12kulikjaksetpull_requests: -pull_request21199
2020-09-05 19:32:02kulikjaksetnosy: +kulikjak

pull_requests: +pull_request21199
2020-08-29 16:34:00rhettingersetnosy: +rhettinger

pull_requests: +pull_request21112
2018-08-08 15:14:16lukasz.langasetmessages: +msg323291
2018-08-06 15:39:08Steapsetnosy: +Steap
messages: +msg323213
2018-06-08 16:55:14barrysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-06-08 14:01:58miss-islingtonsetnosy: +miss-islington
messages: +msg319065
2018-06-08 11:04:00miss-islingtonsetpull_requests: +pull_request7164
2018-06-08 11:02:52lukasz.langasetmessages: +msg319046
2018-06-08 10:04:35vinay.sajipsetnosy: +vinay.sajip
2018-06-08 09:22:13lukasz.langasetmessages: +msg319037
2018-06-08 09:19:48lukasz.langasetpull_requests: +pull_request7152
2018-06-08 03:39:17ned.deilysetnosy: +lukasz.langa
2018-06-08 00:45:25barrysetkeywords: +patch
stage: needs patch -> patch review
pull_requests: +pull_request7137
2018-06-07 23:22:14barrysetmessages: +msg318984
2018-06-07 23:00:35barrycreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp