[Vobject] vcard 3.0 parsing error

Jonathan Kaczynski jmkacz at gmail.com
Tue Dec 2 16:39:47 CST 2008


I've been using vobject for a few months and have just run into an issue.

I exported a contact from Google Gmail, and CRLF was represented as
"=0D=OA=".

Neither vobject-0.6.6 nor vobject-0.7.1 handled it.

>>> import vobject
>>> data = """BEGIN:VCARD
... VERSION:3.0
... FN:John Smith
... LABEL;TYPE=HOME;ENCODING=QUOTED-PRINTABLE:34 Main St=0D=0A=
... Apt 8H=0D=0A=
... Edison, NJ 08837
... END:VCARD"""
>>> v = vobject.readOne( data )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/var/lib/python-support/python2.5/vobject/base.py", line 1011, in
readOne
    ignoreUnreadable).next()
  File "/var/lib/python-support/python2.5/vobject/base.py", line 968, in
readComponents
    vline = textLineToContentLine(line, n)
  File "/var/lib/python-support/python2.5/vobject/base.py", line 845, in
textLineToContentLine
    return ContentLine(*parseLine(text, n), **{'encoded':True, 'lineNumber'
: n})
  File "/var/lib/python-support/python2.5/vobject/base.py", line 714, in
parseLine
    raise ParseError("Failed to parse line: %s" % line, lineNumber)
vobject.base.ParseError: At line 5: Failed to parse line: Apt 8H=0D=0A=

It seems that at least one other project has the same issue: vpim for ruby (
http://ep.blogware.com/blog/_archives/2008/5/14/3690826.html).

Thanks,
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.skyhouseconsulting.com/pipermail/vobject/attachments/20081202/b6efdfcc/attachment.htm 


More information about the VObject mailing list