You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.
from pyxmpp.jabber.vcard import VCard, VCardName
v = VCard('')
n = VCardName('N', '')
n.given = 'Christopher; a semi-colon and a sentence, too.'
v.content['N'] = n
v.as_xml().serialize()
'\nChristopher; a semi-colon and a sentence, too.\n'
xml = [c for c in v.as_xml().children][0] #list comprehension to compensate for \nChristopher; a semi-colon and a sentence, too.Christopher; a semi-colon and a sentence, too.\n'
v.rfc2426()
'begin:VCARD\r\nversion:3.0\r\nn:;Christopher; a semi-colon and a sentence, too.;;;\r\nend:VCARD\r\n'
v3 = VCard(v.rfc2426())
Traceback (most recent call last):
File "", line 1, in
File "C:\workspace\lib\pyxmpp\jabber\vcard.py", line 1363, in init
self.n = None
File "C:\workspace\lib\pyxmpp\jabber\vcard.py", line 1477, in from_rfc2426
continue
File "C:\workspace\lib\pyxmpp\jabber\vcard.py", line 1508, in _process_rfc2425_record
if params:
File "C:\workspace\lib\pyxmpp\jabber\vcard.py", line 303, in __init
n=n.next
ValueError: too many values to unpack
}}}
since the semicolons are not backslash escaped, nor unescaped, string values with ';' in them cannot be handled properly.
a regex which can be used to properly split strings with escaped semicolons using a negative lookbehind assertion:
{{{non_quoted_semicolon_re=re.compile(r'(?<!);')}}}
I'll append patches and such as I finalize my fixes.
The text was updated successfully, but these errors were encountered:
{{{
since the semicolons are not backslash escaped, nor unescaped, string values with ';' in them cannot be handled properly.
a regex which can be used to properly split strings with escaped semicolons using a negative lookbehind assertion:
{{{non_quoted_semicolon_re=re.compile(r'(?<!);')}}}
I'll append patches and such as I finalize my fixes.
The text was updated successfully, but these errors were encountered: