[Vobject] commas in structured fields

Adam Tauno Williams awilliam at opengroupware.us
Fri Jan 28 13:05:10 CST 2011


On Fri, 2011-01-28 at 13:38 -0500, Bob Kline wrote: 
> do the same thing in one of the strings for the Name
> constructor, a ParseError exception is thrown when I try to serialize
> the card object.  Continuing with the example above:
> >>> card.n.value = vobject.vcard.Name('Stooge', 'Larry, Moe, and Curly')
> >>> card.serialize()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/pymodules/python2.6/vobject/base.py", line 186, in
> serialize

Works for me.

import vobject
card = vobject.vCard()
card.add('fn').value = 'Larry, Moe, and Curly Stooge'
card.add('n').value =vobject.vcard.Name('Stooge', 'Larry, Moe, and
Curly')
print card.serialize()

BEGIN:VCARD
VERSION:3.0
FN:Larry\, Moe\, and Curly Stooge
N:Stooge;Larry\, Moe\, and Curly;;;
END:VCARD




More information about the VObject mailing list