New submission from 林自均:

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.

----------
components: Library (Lib)
messages: 302604
nosy: johnlinp
priority: normal
severity: normal
status: open
title: Let ConfigParser parse systemd units
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31528>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to