[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#834498: marked as done (qtqr: Can't handle non-ASCII characters)



Your message dated Tue, 15 Oct 2019 10:35:28 +0200
with message-id <a2e93ed5-e396-0c02-6a31-747fb557ff8b@debian.org>
and subject line Re: qtqr: Can't handle non-ASCII characters
has caused the Debian Bug report #834498,
regarding qtqr: Can't handle non-ASCII characters
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
834498: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=834498
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
On Tue, 16 Aug 2016 12:25:57 +0200 "Ph. Marek" <philipp.marek@linbit.com> wrote:
> 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'
> 
> 


looks like fixed already in a new upstream release

G.

> 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

--- End Message ---

Reply to: