Package: qtqr
Version: 1.4~bzr21-1
Severity: important
Trying to scan a business card with non-ASCII letter in the VCard causes
qtqr to throw Python errors.
Eg., a VCARD that has
TITLE:Geschäftsführer
in it first throws
in ZBar Processor data_handler:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/qrtools.py", line 217, in
my_handler
self.data_type = self.data_recognise()
File "/usr/lib/python2.7/dist-packages/qrtools.py", line 89, in
data_recognise
if data_lower.startswith(u"http://") or
data_lower.startswith(u"https://"): return u'url'
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 74:
ordinal not in range(128)
Trying to get it working by
--- /usr/lib/python2.7/dist-packages/qrtools.py.ORIG 2016-08-16
12:14:09.472868768 +0200
+++ /usr/lib/python2.7/dist-packages/qrtools.py 2016-08-16 12:19:01.298722887
+0200
@@ -85,7 +85,7 @@
def data_recognise(self, data = None):
"""Returns an unicode string indicating the data type of the data
paramater"""
data = data or self.data
- data_lower = data.lower()
+ data_lower = data.lower().decode("utf-8")
if data_lower.startswith(u"http://") or
data_lower.startswith(u"https://"): return u'url'
elif data_lower.startswith(u"mailto:"): return u'email'
elif data_lower.startswith(u"matmsg:to:"): return u'emailmessage'
does help a bit, but then it crashes again with
text:
Traceback (most recent call last):
File "/usr/bin/qtqr", line 718, in decodeWebcam
self.showInfo(qr)
File "/usr/bin/qtqr", line 571, in showInfo
print data.encode(u"utf-8")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 74:
ordinal not in range(128)
Using straight "zbarcam" works as expected - I just get the VCARD info
printed to the screen.
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1,
'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages qtqr depends on:
ii python-qrtools 1.4~bzr21-1
ii python-qt4 4.11.4+dfsg-2
pn python:any <none>
qtqr recommends no packages.
qtqr suggests no packages.
-- no debconf information