Skip to content

Add missing BINARY member to the VALUE enum - #1608

Merged
stevepiercy merged 3 commits into
collective:mainfrom
vtino17:fix/value-enum-missing-binary
Jul 29, 2026
Merged

Add missing BINARY member to the VALUE enum#1608
stevepiercy merged 3 commits into
collective:mainfrom
vtino17:fix/value-enum-missing-binary

Conversation

@vtino17

@vtino17 vtino17 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Linked issue

Description

icalendar.enums.VALUE enumerates the value types from :rfc:5545 section 3.2.20, but it 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. Despite that, VALUE.BINARY raised AttributeError.

This PR:

  • adds BINARY = "BINARY" to VALUE (in RFC order, before BOOLEAN);
  • adds BINARY to the class docstring's Attributes: list;
  • adds tests that VALUE matches the RFC 5545 section 3.2.20 value-type set, that VALUE.BINARY == "BINARY", and that vBinary.default_value is a VALUE member.

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

  • I added a change log entry, following the instructions in Change log entry format.
  • I followed icalendar's Artificial intelligence policy and disclosed my Responsible AI use in my commit messages, if applicable.
  • I added or updated tests, if applicable.
  • I ran and ensured all tests pass locally by following Run tests.
  • I added or edited documentation as necessary, both as docstrings to be rendered in the API documentation and narrative documentation, following the Style guide.

Additional information

I verified locally that the three new tests fail before the fix and pass after it. Related tests (test_enums.py, and the binary / image / parameter_access selections) pass. As with my other local runs, the only unrelated failure is test_fuzzing.py, which needs the optional hypothesis dependency 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.

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.
@github-actions github-actions Bot added the ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding. label Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request did not pass quality checks and AI use is suspected. Please review Contribute and make any necessary amendments.

@github-actions

Copy link
Copy Markdown
Contributor

Profile summary:

GitHub user: vtino17
🟡 Some concerns found with user's profile.
🟡 Some concerns found with recent PR activity.
🟢 No concerns found with recent issue activity.

For a more detailed report, run `gh-profiler vtino17`.
Full profile
GitHub user: vtino17
🟡 Some concerns found with user's profile.
   🟡 Account age: 1 year, 11 months
   🟢 Profile information:
        name: Valentino Saputra
        blog: https://above.my.id
        location: Sungailiat, Bangka Belitung
        email: vsvalentinosaputra.98@gmail.com
        bio: Anything
        instagram: https://www.instagram.com/vtinosaputra
      Empty fields: company

🟡 Some concerns found with recent PR activity.
   78 PRs opened in the last 21 days.
      48 opened against repos the user owns.
      0 opened against repos in publicly associated orgs.
      30 opened against external repos.

   🟡 14 of 30 external PRs closed without merging in the last 21 days.

🟢 No concerns found with recent issue activity.
   14 new issues opened in the last 21 days.
      13 opened in repos the user owns.
      0 opened in repos in publicly associated orgs.
      1 opened in external repos.

   🟢 0 external issues closed as NOT_PLANNED.
   🟢 0 external issues opened with the same title.

@read-the-docs-community

read-the-docs-community Bot commented Jul 28, 2026

Copy link
Copy Markdown

niccokunzmann
niccokunzmann previously approved these changes Jul 28, 2026

@niccokunzmann niccokunzmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread news/1607.bugfix Outdated

@stevepiercy stevepiercy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

News tweak, then I approve. Thank you!

Comment thread news/1607.bugfix Outdated
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.
@vtino17

vtino17 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @stevepiercy and @angatha. I applied the suggested wording for news/1607.bugfix: linked :rfc:5545#section-3.2.20`` and dropped the "used by the library itself" clause, which as @angatha noted overstated the internal usage. The entry now just states the missing member and the previous AttributeError.

@stevepiercy
stevepiercy enabled auto-merge (squash) July 29, 2026 06:21
@stevepiercy

Copy link
Copy Markdown
Member

Thank you! Will auto-merge when CI passes.

@stevepiercy
stevepiercy merged commit 9e08f22 into collective:main Jul 29, 2026
32 checks passed
@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 97.999% (+0.001%) from 97.998% — vtino17:fix/value-enum-missing-binary into collective:main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-suspicion This contribution is possibly created with lots of AI help without enough human understanding.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] VALUE enum is missing the BINARY value type

5 participants