Skip to content

Read DEFAULT-only ConfigParser configuration files - #362

Merged
bw2 merged 1 commit into
bw2:masterfrom
harbinresearcher:codex/read-default-only-ini
Oct 18, 2026
Merged

bw2 merged 1 commit into
bw2:masterfrom
harbinresearcher:codex/read-default-only-ini

Conversation

@harbinresearcher

Copy link
Copy Markdown
Contributor

Fixes #361.

ConfigparserConfigFileParser.serialize() writes [DEFAULT], but parse() 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:

  • Windows CPython3.12.14 and Linux CPython3.9.25: available suite 159 -> 164 passed, with the same five expected failures.
  • Linux CPython3.14.8 with matching official CPython v3.14.8 Lib/test supplied: 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.
  • Black check passes on pristine and patched trees. CI's strict Pydoctor command passes on both with a task-local intersphinx cache. Zizmor reports no findings with the repository configuration (offline mode).
  • Isolated sdist/wheel build succeeds; installed-wheel tests pass 164 cases with the same five expected failures on Windows.
  • Independent automated read-only review found no actionable issues and independently ran the Windows tests.

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.

@bw2
bw2 merged commit 3ab2f32 into bw2:master Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConfigparserConfigFileParser cannot read its own DEFAULT-only output

2 participants