-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vcard CATEGORIES uses icalendar serilization #138
Comments
Something else in my own code must be causing this for me, because I can't reproduce it with vobject.readOne('BEGIN:VCARD\r\nVERSION:3.0\r\nCATEGORIES;TYPE=Kind:Doctor\r\nFN:Dr. Given Middle Family IV\r\nEND:VCARD\r\n').serialize(); After building {'CATEGORIES': {'Kind': 'Doctor'}, 'FN': 'Dr. Given Middle Family IV'} from the result of readOne, for use in my application, and recreating a vcard from that for exporting from the application, I'm getting: BEGIN:VCARD Unless, I comment out registering icalendar CATERGORIES. I'll keep looking for the root cause. |
My application maps vcard attributes into a dict by cardinality and type-param. From the RFC's ABNF format descriptions, I found that--of the attributes with cardinality of zero or more, and accepting a type-param--both CATEGORIES and NICNAME have values of text-list, while the rest are single URI or single structured. However, NICKNAME is serialized with vobject.vcard.VCardTextBehavior and CATEGORIES with vobject.icalendar.MultiTextBehavior. vobject.readOne('BEGIN:VCARD\r\nVERSION:3.0\r\nCATEGORIES;TYPE=work:Doctor,med\r\nNICNAME;TYPE=home:Nick,Bob\r\nFN:Dr. Given Middle Family IV\r\nEND:VCARD\r\n').serialize() Results in: BEGIN:VCARD Dropping the second nickname in the list, "Bob". Using vobject, my application imports the vcard into: Mangling the CATEGORIES element. If I handle NICKNAME and CATEGORIES as lists: I'll hack the import/export of CATEGORIES and NICKNAMEs in my application, but I hope for some consistency in handling text-list value types when handling comma separated NICKNAMEs is repaired to not drop the tail of the list. |
icalendar registers icalendar.MultiTextBehavior for CATEGORIES (line 1603). This causes CATEGORIES values for vcards to be serialized incorrectly.
The text was updated successfully, but these errors were encountered: