Skip to content

feat(prop/xml): add bytes property to vXml for parity with vBinary (fixes #2019) - #2030

Open
RajGahoi wants to merge 12 commits into
PyCalendar:mainfrom
RajGahoi:feat/issue-2019-vxml-bytes-property
Open

RajGahoi wants to merge 12 commits into
PyCalendar:mainfrom
RajGahoi:feat/issue-2019-vxml-bytes-property

Conversation

@RajGahoi

Copy link
Copy Markdown

Linked issue

Description

This PR implements the requested .bytes property on vXml to provide interface parity with vBinary.bytes:

  • Added @property def bytes(self) -> bytes on vXml returning self.encode("utf-8").
  • Added unit tests in src/icalendar/tests/rfc_6321_xcal/test_xml_property.py verifying that vXml.bytes returns UTF-8 bytes and has consistent behavior with vBinary.bytes.
  • Added towncrier news entry news/2019.feature.

Checklist

  • I added a change log entry, following the instructions in all subsections under Change log requirements.
  • 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.

…ixes PyCalendar#2019)

- Add .bytes property to vXml returning UTF-8 encoded bytes
- Add unit tests validating vXml.bytes behavior and interface consistency with vBinary.bytes
- Add towncrier news fragment news/2019.feature

Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the pull request, @RajGahoi! A maintainer will review it shortly.

@github-actions

Copy link
Copy Markdown
Contributor

Automation signals

Activity patterns show signs of automation.

View full analysis →

Report this account →

Evidence
  • Fork spike detected: Burst of 13 fork events in a single 24-hour window

This is an automated analysis by AgentScan

@github-actions github-actions Bot added the agentscan:automated-account AgentScan flagged this item as coming from an automated account, and it needs review label Oct 25, 2026
Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
Comment thread docs/conf.py Resolved
niccokunzmann added a commit to PyCalendar/community-insights that referenced this pull request Oct 29, 2026
AI Prompts:
claude-opus-5-5: <ide_opened_file>The user opened the file ./Dockerfile in the IDE. This may or may not be related to the current task.</ide_opened_file> PyCalendar/icalendar#2030  First response is incorrect: There was a review. Reviews count as a first response, too.
claude-opus-5-5: to the env example add all configuration variables, propertly in sections that can be used with explanation
@angatha

angatha commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

@RajGahoi can you please respond to my question. Otherwise I will close the PR in at least seven days.

@RajGahoi

RajGahoi commented Nov 7, 2026

Copy link
Copy Markdown
Author

Hi @angatha, apologies for the delay! That suppress_warnings = ["ref.python"] was originally added during a local doc build to silence cross-reference warnings, but it is not necessary. I have reverted it so docs/conf.py remains clean and unchanged. All unit tests pass cleanly. Thank you for catching that!

Comment thread src/icalendar/prop/xml.py
"""The XML text encoded as UTF-8 bytes.

This provides a consistent interface with :attr:`~icalendar.prop.binary.vBinary.bytes`.
"""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add versionadded:: 0.0.0

Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
@RajGahoi

Copy link
Copy Markdown
Author

Merged latest \main\ to resolve conflicts, kept \docs/conf.py\ untouched, and added .. versionadded:: 0.0.0\ to \�Xml.bytes. Ready for another look, @angatha!

@stevepiercy
stevepiercy requested a review from angatha November 18, 2026 22:05
Comment thread docs/conf.py Resolved
…ytes

Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
@RajGahoi
RajGahoi force-pushed the feat/issue-2019-vxml-bytes-property branch from c1eba94 to 9dfa091 Compare November 19, 2026 09:18
Comment thread docs/conf.py Resolved
Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
… with vBinary/vXml

Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
…rence

Signed-off-by: Raj Gahoi <gahoiraj01@gmail.com>
Comment thread docs/conf.py
Comment on lines +36 to +48

# -- Sphinx logging filters --------------------------------------------------
# Suppress known Sphinx ambiguity between built-in bytes and vBinary/vXml.bytes
class SphinxWarningFilter(logging.Filter):
def filter(self, record):
return (
"more than one target found for cross-reference 'bytes'"
not in record.getMessage()
)


logging.getLogger("sphinx").addFilter(SphinxWarningFilter())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@stevepiercy do we wan't this?
@RajGahoi what does it do and when is it relveant?

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.

No. Suppression does not resolve the issue. This is not acceptable.

This branch has not been deployed

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

Labels

agentscan:automated-account AgentScan flagged this item as coming from an automated account, and it needs review PR quality: good

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vXml: add a bytes property like vBinary

4 participants