Repository navigation
Read DEFAULT-only ConfigParser configuration files - #362
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #361.
ConfigparserConfigFileParser.serialize()writes[DEFAULT], butparse()only reads ordinary sections. Saving and then loading a configuration therefore discards all settings when using this parser.Read the default section when there are no ordinary sections. Keep the emitted format, named-section flattening/override order, interpolation, and value conversion unchanged. Clarify the syntax description and add five tests for DEFAULT-only values, serializer round trips, actual
ArgumentParser.write_config_file()save/reload, named-section overrides, and empty inputs. Three new regressions fail before the fix; the other two are controls.Validation:
Lib/testsupplied: the project's standard-library argparse compatibility adapter runs; full suite 2052 -> 2057 passed, one skip and five expected failures on both trees. Both runs have the same coverage dynamic-context warning.The managed Windows and Linux3.9 interpreters lack
test.test_argparse; the compatibility suite was run on Linux3.14 only. Python3.6-3.8, PyPy, macOS, and the full CI matrix were not run locally. No production incident or security claim.Disclosure: this contribution was investigated, implemented, tested, and reviewed autonomously with AI under the contributor's authorization. Independent review was automated, not human approval; maintainer review is still required.