This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ConfigParser has optionxform, but not sectionxform
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: lukasz.langa Nosy List: Anaphory, cheryl.sabella, lukasz.langa, xiang.zhang
Priority: normal Keywords: patch

Created on 2016-03-11 06:40 by Anaphory, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
add_sectionxform.patch xiang.zhang, 2016-05-06 10:40 review
Messages (5)
msg261543 - (view) Author: Gereon Kaiping (Anaphory) Date: 2016-03-11 06:40
configparser.ConfigParser (resp. ConfigParser.RawConfigParser for python2) has a optionxform function which converts the option names in a section to lower case by default.

A similar function for section titles would be expected (cf. https://github.com/lmaurits/BEASTling/issues/46#issuecomment-195131900), but it does not exist.

If ConfigParser called such a function (reasonably named sectionxform), which would default to None (or the identity function) for backward compatibility, that would be nice and consistent.
msg264679 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2016-05-02 23:09
I agree sectionxform would be nice. Care to author a patch?

The current workaround is modifying the SECTCRE regular expression.
msg264961 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-05-06 10:40
I write a patch to add sectionxform. It wraps necessary section name operation I think. Hope to have some feedback.
msg269150 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2016-06-24 02:42
ping
msg332569 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-12-27 00:08
Would it be worthwhile to convert this patch to a PR for 3.8?
History
Date User Action Args
2022-04-11 14:58:28adminsetgithub: 70724
2019-03-29 06:50:17methanesetversions: + Python 3.8, - Python 3.6
2018-12-27 00:08:49cheryl.sabellasetnosy: + cheryl.sabella
messages: + msg332569
2016-07-08 07:12:57berker.peksaglinkissue11027 superseder
2016-06-24 02:42:43xiang.zhangsetmessages: + msg269150
2016-05-06 10:40:04xiang.zhangsetfiles: + add_sectionxform.patch
keywords: + patch
messages: + msg264961
2016-05-03 16:03:22xiang.zhangsetnosy: + xiang.zhang
2016-05-02 23:09:16lukasz.langasetassignee: lukasz.langa
2016-05-02 23:09:09lukasz.langasetmessages: + msg264679
2016-03-11 06:47:37serhiy.storchakasetnosy: + lukasz.langa
2016-03-11 06:47:21serhiy.storchakasettitle: ConfigParser has optoinxform, but not sectionxform -> ConfigParser has optionxform, but not sectionxform
type: enhancement
versions: - Python 2.7, Python 3.5
2016-03-11 06:40:17Anaphorycreate