Add missing BINARY member to the VALUE enum - #1608
Merged
stevepiercy merged 3 commits intoJul 29, 2026
Merged
Conversation
icalendar.enums.VALUE enumerates the RFC 5545 section 3.2.20 value types but omitted BINARY, the first value type in that list. BINARY is used by the library itself: vBinary.default_value is "BINARY" and serializes as VALUE=BINARY, and IMAGE accepts VALUE=BINARY. Yet VALUE.BINARY raised AttributeError. Added BINARY = "BINARY" to the enum (in RFC order) and to the class docstring's Attributes list, plus tests that VALUE matches the RFC 5545 value-type set and that vBinary's default value is a VALUE member. Closes collective#1607. AI disclosure (per icalendar's AI policy): this change was prepared with the assistance of Anthropic's Claude Opus 4.8, used as a coding agent. It found the omission by auditing enums.py against RFC 5545, wrote the fix and the tests, and verified locally that the new tests fail before the fix and pass after it. The author reviewed and takes responsibility for the change.
vtino17
requested review from
SashankBhamidi,
angatha,
niccokunzmann and
stevepiercy
as code owners
July 28, 2026 03:14
Contributor
|
This pull request did not pass quality checks and AI use is suspected. Please review Contribute and make any necessary amendments. |
Contributor
|
Profile summary: Full profile |
angatha
reviewed
Jul 28, 2026
stevepiercy
requested changes
Jul 29, 2026
stevepiercy
left a comment
Member
There was a problem hiding this comment.
News tweak, then I approve. Thank you!
Applies stevepiercy's suggested wording on news/1607.bugfix and removes the clause angatha flagged as overclaiming the library's internal use. AI disclosure: prepared with the assistance of Anthropic's Claude Opus 4.8.
Contributor
Author
|
Thanks @stevepiercy and @angatha. I applied the suggested wording for |
angatha
approved these changes
Jul 29, 2026
stevepiercy
approved these changes
Jul 29, 2026
stevepiercy
enabled auto-merge (squash)
July 29, 2026 06:21
Member
|
Thank you! Will auto-merge when CI passes. |
Collaborator
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.
Linked issue
VALUEenum is missing theBINARYvalue type #1607Description
icalendar.enums.VALUEenumerates the value types from :rfc:5545section 3.2.20, but it omittedBINARY, the first value type in that list.BINARYis used by the library itself:vBinary.default_valueis"BINARY"and serializes asVALUE=BINARY, andIMAGEacceptsVALUE=BINARY. Despite that,VALUE.BINARYraisedAttributeError.This PR:
BINARY = "BINARY"toVALUE(in RFC order, beforeBOOLEAN);BINARYto the class docstring'sAttributes:list;VALUEmatches the RFC 5545 section 3.2.20 value-type set, thatVALUE.BINARY == "BINARY", and thatvBinary.default_valueis aVALUEmember.There is no behavioural change to parsing or serialization; this completes the public enum so it matches the RFC and the library's own use of
VALUE=BINARY.Checklist
Additional information
I verified locally that the three new tests fail before the fix and pass after it. Related tests (
test_enums.py, and thebinary/image/parameter_accessselections) pass. As with my other local runs, the only unrelated failure istest_fuzzing.py, which needs the optionalhypothesisdependency that will not build in my environment; it is available in CI.AI disclosure: this change was prepared with the assistance of Anthropic's Claude Opus 4.8, used as a coding agent to audit the enums against RFC 5545, write the fix and tests, and verify them locally. I reviewed the change and take responsibility for it. This is also disclosed in the commit message and the change log entry.