Skip to content

Let ConfigParser parse systemd units #75709

Open

Description

@johnlinp
mannequin
BPO 31528
Nosy @mcepl, @ambv, @cooperlees, @bbayles, @johnlinp

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 = None
closed_at = None
created_at = <Date 2017-09-20.08:40:09.170>
labels = ['3.8', 'type-feature', 'library']
title = 'Let ConfigParser parse systemd units'
updated_at = <Date 2021-09-02.23:45:07.318>
user = 'https://github.com/johnlinp'

bugs.python.org fields:

activity = <Date 2021-09-02.23:45:07.318>
actor = 'cooperlees'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2017-09-20.08:40:09.170>
creator = 'johnlinp'
dependencies = []
files = []
hgrepos = []
issue_num = 31528
keywords = []
message_count = 1.0
messages = ['302604']
nosy_count = 5.0
nosy_names = ['mcepl', 'lukasz.langa', 'cooperlees', 'bbayles', 'johnlinp']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue31528'
versions = ['Python 3.8']

Activity

  1. johnlinp commented on Sep 20, 2017

    johnlinpmannequin
    MannequinAuthor

    Although systemd units are inspired by .ini format, ConfigParser is unable to parse those files because:

    1. Multiple assignments to the same option in systemd units are concatenated with white spaces.
    2. Multiple sections with the same section name are merged.
    3. An option assignment of empty value resets the option.

    I suggest 3 corresponding parameters in ConfigParser.__init__():

    1. merge_options: If set to True, multiple assignment to the same option are concatenated with white spaces. Default is False.
    2. merge_sections: If set to True, multiple sections with the same name are merged. Default is False.
    3. empty_is_reset: Only relevant when merge_options is True. If set to True, an option assignment of empty value will reset the option. Default is False.
  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancement
    on Sep 20, 2017
  3. transferred this issue fromon Apr 10, 2022
  4. serhiy-storchaka commented on Jul 30, 2023

    @serhiy-storchaka
    Member

    See also #56871, #65528 and #107430.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.8 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions