Package: python-vobject
Version: 0.9.2-2
Severity: important
Tags: patch

Dear Maintainer,

Without the commit referred to org fields are mangled by vobject when
trying to join a list that is actually a string.

Please apply the patch attached, also available from upstream Git repo
as commit fe78218bb985966037a2096983b2e9faac243d0b.

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=sv_SE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python-vobject depends on:
ii  python-dateutil  2.4.2-1
pn  python:any       <none>

python-vobject recommends no packages.

python-vobject suggests no packages.

-- no debconf information
commit fe78218bb985966037a2096983b2e9faac243d0b
Author: Markus Unterwaditzer <mar...@unterwaditzer.net>
Date:   2016-04-13 22:43:39 +0200

    vcard: Fix ORG fields with multiple components

diff --git a/test_files/simple_3_0_test.ics b/test_files/simple_3_0_test.ics
index d5e4642..1faf80d 100644
--- a/test_files/simple_3_0_test.ics
+++ b/test_files/simple_3_0_test.ics
@@ -9,5 +9,5 @@ TEL;type=CELL:+01-(0)5-555.55.55
 ACCOUNT;type=HOME:010-1234567-05
 ADR;type=HOME:;;Haight Street 512\;\nEscape\, Test;Novosibirsk;;80214;Gnuland
 TEL;type=HOME:+01-(0)2-876.54.32
-ORG:University of Novosibirsk, Department of Octopus Parthenogenesis
+ORG:University of Novosibirsk;Department of Octopus Parthenogenesis
 END:VCARD
diff --git a/tests.py b/tests.py
index 2073930..6b0fad9 100644
--- a/tests.py
+++ b/tests.py
@@ -516,9 +516,14 @@ class TestVcards(unittest.TestCase):
         #)
         self.assertEqual(
             card.org.value,
-            "University of Novosibirsk, Department of Octopus Parthenogenesis"
+            ["University of Novosibirsk", "Department of Octopus Parthenogenesis"]
         )
 
+        for _ in range(3):
+            new_card = base.readOne(card.serialize())
+            self.assertEqual(new_card.org.value, card.org.value)
+            card = new_card
+
 
 class TestIcalendar(unittest.TestCase):
     """
diff --git a/vobject/vcard.py b/vobject/vcard.py
index dd60b73..0aec844 100644
--- a/vobject/vcard.py
+++ b/vobject/vcard.py
@@ -338,6 +338,7 @@ class OrgBehavior(VCardBehavior):
         if obj.isNative:
             return obj
         obj.isNative = True
+        obj.value = splitFields(obj.value)
         return obj
 
     @staticmethod

Reply via email to