Skip to content

fix(config): preserve saved list values - #366

Merged
bw2 merged 1 commit into
bw2:masterfrom
awais-ur-rehman:feat/preserve-list-config-values
Nov 2, 2026
Merged

bw2 merged 1 commit into
bw2:masterfrom
awais-ur-rehman:feat/preserve-list-config-values

Conversation

@awais-ur-rehman

Copy link
Copy Markdown
Contributor

Summary

Saving ['a,b', 'c'] with the default config parser currently writes [a,b, c], which reads back as three entries. JSON-looking strings, empty entries, surrounding whitespace, and nested lists can also change when saved.

Write list values using the JSON syntax the parser already accepts. Scalar formatting and the existing rejection of literal newlines remain unchanged; saved string lists now contain quotes. The round-trip regression covers commas, padding, empty strings, quotes, backslashes, numeric/boolean-looking strings, and nested lists. Existing exact-output tests are updated for JSON quoting.

Testing

On Python 3.13, the full suite passes: 2,026 passed, one skipped, five expected failures. Black, the repository's warnings-as-errors Pydoctor documentation check, and source/wheel builds pass. Codex assisted with this fix and its tests.

Breaking Changes

Saved list values now use JSON quoting. The parser already accepts that syntax; scalar formatting and literal-newline rejection are preserved.

Manual verification: Serialize {'files': ['a,b', 'c']} with the default parser and parse it again; the list should retain exactly two original elements.

@bw2
bw2 merged commit 4a4b64f into bw2:master Nov 2, 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.

2 participants