Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jun 2019 09:24:07 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 238543] www/pycarddav: Syncing a contact with UTF-8 characters fails
Message-ID:  <bug-238543-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D238543

            Bug ID: 238543
           Summary: www/pycarddav: Syncing a contact with UTF-8 characters
                    fails
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: bla@a999.de
                CC: samir@noir.im
             Flags: maintainer-feedback?(samir@noir.im)
                CC: samir@noir.im
 Attachment #205028 text/plain
         mime type:

Created attachment 205028
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D205028&action=
=3Dedit
Instead of unconditionally returning unicode, i check for the used charset =
with
chardet.detect()

During syncing with an owncloud instance with the command:
$ pycardsyncer=20
one gets the following error, in case utf8 characters like =C3=84 (German u=
mlaut A)
are included in a contact there will show the following crash:

Traceback (most recent call last):
  File "/usr/local/bin/pycardsyncer", line 55, in <module>
    sync(conf)
  File "/usr/local/lib/python2.7/site-packages/pycarddav/controllers/sync.p=
y",
line 57, in sync
    my_dbtool.update(vcard, conf.account.name, href=3Dhref, etag=3Detag)
  File "/usr/local/lib/python2.7/site-packages/pycarddav/backend.py", line =
272,
in update
    stuple =3D (etag, vcard.name, vcard.fname, vcard_s, status, href, href)
  File "/usr/local/lib/python2.7/site-packages/pycarddav/model.py", line 20=
1,
in name
    return unicode(self['N'][0][0]) if self['N'] else ''
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ord=
inal
not in range(128)

I assume, that the error is not owncloud specific. It is only necessary to =
have
a changed contact
with an utf8 character in the Name.

I could fix the problem and the patch is in the appendix.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-238543-7788>