Issue 26537: ConfigParser has optionxform, but not sectionxform (original) (raw)

Issue26537

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.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/70724

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:28 admin set github: 70724
2019-03-29 06:50:17 methane set versions: + Python 3.8, - Python 3.6
2018-12-27 00:08:49 cheryl.sabella set nosy: + cheryl.sabellamessages: +
2016-07-08 07:12:57 berker.peksag link issue11027 superseder
2016-06-24 02:42:43 xiang.zhang set messages: +
2016-05-06 10:40:04 xiang.zhang set files: + add_sectionxform.patchkeywords: + patchmessages: +
2016-05-03 16:03:22 xiang.zhang set nosy: + xiang.zhang
2016-05-02 23:09:16 lukasz.langa set assignee: lukasz.langa
2016-05-02 23:09:09 lukasz.langa set messages: +
2016-03-11 06:47:37 serhiy.storchaka set nosy: + lukasz.langa
2016-03-11 06:47:21 serhiy.storchaka set title: ConfigParser has optoinxform, but not sectionxform -> ConfigParser has optionxform, but not sectionxformtype: enhancementversions: - Python 2.7, Python 3.5
2016-03-11 06:40:17 Anaphory create