Reading QR codes from file fails due to "Exception: tostring() has been removed. Please call tobytes() instead."

Bug #1589965 reported by Karl-Philipp Richter
50
This bug affects 8 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Medium
Unassigned
QR Tools
Undecided
Unassigned
qr-tools (Ubuntu)
Medium
Unassigned
Xenial
Medium
Unassigned

Bug Description

Terminal output right after requesting decoding from file:

    /usr/lib/python2.7/dist-packages/PIL/Image.py:870: UserWarning: Palette images with Transparency expressed in bytes should be converted to RGBA images
      'to RGBA images')
    Traceback (most recent call last):
      File "/usr/bin/qtqr", line 540, in decodeFile
        if qr.decode():
      File "/usr/lib/python2.7/dist-packages/qrtools.py", line 181, in decode
        raw = pil.tostring()
      File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 695, in tostring
        "Please call tobytes() instead.")
    Exception: tostring() has been removed. Please call tobytes() instead.
    Traceback (most recent call last):
      File "/usr/bin/qtqr", line 540, in decodeFile
        if qr.decode():
      File "/usr/lib/python2.7/dist-packages/qrtools.py", line 181, in decode
        raw = pil.tostring()
      File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 695, in tostring
        "Please call tobytes() instead.")
    Exception: tostring() has been removed. Please call tobytes() instead.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: qtqr 1.4~bzr21-1
Uname: Linux 4.5.5-040505-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Jun 7 14:41:34 2016
InstallationDate: Installed on 2013-10-17 (963 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
PackageArchitecture: all
SourcePackage: qr-tools
UpgradeStatus: Upgraded to xenial on 2016-03-04 (94 days ago)

Revision history for this message
Karl-Philipp Richter (krichter722) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qr-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Egor (gluk47) wrote :

And the fix is obvious. Go to the file '/usr/lib/python2.7/dist-packages/qrtools.py', the line 181 (as root) and replace 'tostring()' with 'tobytes()'.

Can it please be fixed?

Changed in qr-tools (Ubuntu):
importance: Undecided → Medium
Changed in qr-tools:
status: New → Confirmed
Changed in hundredpapercuts:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Nosphky (philip-jackson) wrote :

I applied the change to qrtools.py (comment #3 above) and this solved my problem. qtqr now decodes nicely.

Revision history for this message
Ramiro Algozino (algozino) wrote :

This has already been fixed in the revision 23, available in the daily ppa:

http://bazaar.launchpad.net/~qr-tools-developers/qr-tools/trunk/revision/23

Changed in qr-tools (Ubuntu):
status: Confirmed → Fix Released
Changed in qr-tools:
status: Confirmed → Fix Released
Revision history for this message
Alberto Salvia Novella (es20490446e) wrote :

@ Ramiro Algozino

You marked this bug as "fix released" for Ubuntu. But, as I just clarified by the Ubuntu Bug Master, that's only correct if the fix is already published in the development version of Ubuntu, not in a PPA.

Moreover, even if the bug was fixed in Yakkety, the bug needed to be nominated for Xenial and marked as "confirmed" for that release. Otherwise it would never get fixed there.

Changed in qr-tools (Ubuntu):
status: Fix Released → Fix Committed
Changed in qr-tools (Ubuntu Xenial):
status: New → Triaged
importance: Undecided → Medium
Changed in hundredpapercuts:
status: Confirmed → Triaged
Revision history for this message
Boyuan Yang (hosiet) wrote :

Version 1.4~bzr23 migrated into Ubuntu. Fixed in Ubuntu 17.10.

Changed in qr-tools (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Paul White (paulw2u) wrote :

Xenial release is no longer supported so marking Papercuts task as fixed.

Changed in hundredpapercuts:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers