Repository navigation
Preserve valueless INI options when decoding - #618
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #618 +/- ##
=======================================
Coverage 98.52% 98.52%
=======================================
Files 64 64
Lines 2437 2439 +2
=======================================
+ Hits 2401 2403 +2
Misses 36 36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fabiocaccamo
approved these changes
Oct 9, 2026
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.
Describe your changes
Loading
[app]\nflag\ncount = 2\nwithallow_no_value=Truecurrently raisesValueError: the INI serializer attemptsint(None)after configparser accepts the valueless option. PreserveNonebefore trying numeric/boolean conversions, including defaults inherited by sections.Tests cover valueless section/default options, the constructor and
from_ini(), empty strings versus missing values, ordinary typed values, and rejection whenallow_no_valueis omitted or false.Related issue
Fixes #617.
All-state searches for
allow_no_valuefound no matching issue or PR. Related INI changes #265 (case handling) and #289 (nested structures) do not address this conversion failure.Validation
Linux, Python 3.12.15, dependencies from
requirements.txtandrequirements-test.txt:coverage run --source=benedict -m unittestruns 920 tests, 919 pass and 1 skips; total coverage 98%.pre-commit run --all-filespasses all configured hooks, including Ruff 0.16.9 and mypy 2.3.1.Checklist before requesting a review
AI disclosure: OpenAI Codex investigated and reproduced the bug, prepared the code/tests, reviewed the final diff, ran verification, and drafted this description.