-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hi!
As part of my workflow, I want to save my Config to disk so I can reload it later. However, if the config contains a *
section this fails.
Minimal example:
from confection import Config
test_cfg = """[test]
foo = bar
[test.*]
bar = foo
"""
cfg = Config().from_str(test_cfg)
cfg.to_str()
This results in
File "e:\lasse\test\psycop-common\test_confection.py", line 12, in <module>
cfg.to_str()
File "E:\ProgramData\Anaconda3\envs\psycop-main\lib\site-packages\confection\__init__.py", line 419, in to_str
flattened.set(section_name, key, try_dump_json(value, node))
File "E:\ProgramData\Anaconda3\envs\psycop-main\lib\configparser.py", line 1205, in set
super().set(section, option, value)
File "E:\ProgramData\Anaconda3\envs\psycop-main\lib\configparser.py", line 903, in set
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'test.*'
Tested on Windows and MacOS, using confection 0.1.3 and 0.1.4
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request