Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigParser has optionxform, but not sectionxform #70724

Open
Anaphory mannequin opened this issue Mar 11, 2016 · 5 comments
Open

ConfigParser has optionxform, but not sectionxform #70724

Anaphory mannequin opened this issue Mar 11, 2016 · 5 comments
Assignees
Labels
3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@Anaphory
Copy link
Mannequin

Anaphory mannequin commented Mar 11, 2016

BPO 26537
Nosy @ambv, @zhangyangyu, @csabella
Files
  • add_sectionxform.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ambv'
    closed_at = None
    created_at = <Date 2016-03-11.06:40:17.487>
    labels = ['3.8', 'type-feature', 'library']
    title = 'ConfigParser has optionxform, but not sectionxform'
    updated_at = <Date 2019-03-29.06:50:17.393>
    user = 'https://bugs.python.org/Anaphory'

    bugs.python.org fields:

    activity = <Date 2019-03-29.06:50:17.393>
    actor = 'methane'
    assignee = 'lukasz.langa'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2016-03-11.06:40:17.487>
    creator = 'Anaphory'
    dependencies = []
    files = ['42752']
    hgrepos = []
    issue_num = 26537
    keywords = ['patch']
    message_count = 5.0
    messages = ['261543', '264679', '264961', '269150', '332569']
    nosy_count = 4.0
    nosy_names = ['lukasz.langa', 'xiang.zhang', 'Anaphory', 'cheryl.sabella']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue26537'
    versions = ['Python 3.8']

    @Anaphory
    Copy link
    Mannequin Author

    Anaphory mannequin commented Mar 11, 2016

    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. lmaurits/BEASTling#46 (comment)), 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.

    @Anaphory Anaphory mannequin added the stdlib Python modules in the Lib dir label Mar 11, 2016
    @serhiy-storchaka serhiy-storchaka changed the title ConfigParser has optoinxform, but not sectionxform Mar 11, 2016
    @serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Mar 11, 2016
    @ambv
    Copy link
    Contributor

    ambv commented May 2, 2016

    I agree sectionxform would be nice. Care to author a patch?

    The current workaround is modifying the SECTCRE regular expression.

    @ambv ambv self-assigned this May 2, 2016
    @zhangyangyu
    Copy link
    Member

    I write a patch to add sectionxform. It wraps necessary section name operation I think. Hope to have some feedback.

    @zhangyangyu
    Copy link
    Member

    ping

    @csabella
    Copy link
    Contributor

    Would it be worthwhile to convert this patch to a PR for 3.8?

    @methane methane added the 3.8 only security fixes label Mar 29, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    5 participants