Skip to content

[Bug] MEMBER / DELEGATED-TO / DELEGATED-FROM set via attributes break to_jcal() and to_xcal() #2076

Open
kasheeesh08/icalendar
#1

Description

@patrickballard

Describe the bug

The MEMBER, DELEGATED-TO and DELEGATED-FROM setters (quoted_list_parameter in src/icalendar/param.py) always store a tuple, even for a single string. The jCal and xCal serialisers only treat list as multi-valued:

  • Parameters._parameter_value_to_jcal (src/icalendar/parser/parameter.py, isinstance(value, list)) raises TypeError for the tuple.
  • Parameters.get_multiple wraps the tuple in a list, so xCal output contains the tuple's repr.

to_ical() works, because param_value checks SEQUENCE_TYPES, which includes tuple.

To reproduce

from xml.etree.ElementTree import Element, tostring
from icalendar import vCalAddress

a = vCalAddress("mailto:x@example.com")
a.MEMBER = "mailto:group@example.com"  # setter stores a tuple
print(repr(a.params["MEMBER"]))

el = Element("attendee")
a.to_xcal(el)
print(tostring(el).decode())

print(a.params.to_jcal())

Output:

('mailto:group@example.com',)
<attendee><parameters><member><cal-address>('mailto:group@example.com',)</cal-address></member></parameters><cal-address>mailto:x@example.com</cal-address></attendee>
Traceback (most recent call last):
  ...
TypeError: Unsupported parameter value type for jCal conversion: <class 'tuple'> ('mailto:group@example.com',)

Expected behavior

  • xCal: <member><cal-address>mailto:group@example.com</cal-address></member>
  • jCal: {"member": "mailto:group@example.com"} (or a one-item list)

Possible fix: treat tuple like list in _parameter_value_to_jcal and get_multiple, for example by checking SEQUENCE_TYPES as param_value does.

Environment

  • Operating system: macOS 15
  • Python version: 3.14.8
  • icalendar version: main @ 22b26c9 (2026-11-08), run from source

Additional context

  • I tested it with the latest version (main @ 22b26c9).
  • There is no .ics sample file.

I searched existing issues and PRs ("jcal tuple", "to_jcal MEMBER", "Unsupported parameter value type", "xcal parameter tuple") and found nothing related.

AI disclosure: this issue was found, reproduced and filed by Claude Opus 5.5 (Claude Code) on my behalf, during an audit of parser/parameter.py. The reproduction above was run on main @ 22b26c9 and the output is copied verbatim.

Activity

  1. github-actions commented on Nov 8, 2026

    @github-actions
    Contributor

    Thanks for the issue, @patrickballard! A maintainer will review it shortly.

  2. github-actions commented on Nov 8, 2026

    @github-actions
    Contributor

    Mixed activity

    Activity patterns show a mix of organic and automated signals.

    View full analysis →

    Evidence
    • Rapid fork→PR pattern: 24/29 fork branches followed by upstream PRs within 21s
    • Multiple forks: 5 repositories forked in a single 24-hour window

    Last 5 PRs:

    This is an automated analysis by AgentScan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentscan:needs-reviewAgentScan flagged this item for review because it has mixed signals

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions