FS#44168 - [python-pillow] Sane module v2.7.0 source bug in sane.py.

Attached to Project: Community Packages
Opened by Evgeny Cherkashin (eugeneai) - Friday, 13 March 2015, 01:47 GMT
Last edited by Kyle Keen (keenerd) - Monday, 23 March 2015, 14:19 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Kyle Keen (keenerd)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Sane module v2.7.0 contains bug in sane.py file.

At beginning, it contains from _sane import *
but in the body _sane.open(...) is used, and an exception raised that the _sane identifier cannot be found.

I've tested Sane module code of v2.8.0 with Pillow-2.7.0, it seems to work well. Also a PKGBUILD atteched to the message to build a new version of the package.

Additional info:
* package version(s)
* config and/or log files etc.

The latest package version, i.e., v2.7.0

An exception raise report example:
File "./sane-pygtk", line 252, in button_preview_clicked_cb
scanner = sane.open(self.sane_devices[scanner_number][0])
File "/usr/lib/python2.7/site-packages/sane.py", line 287, in open
new=SaneDev(devname)
File "/usr/lib/python2.7/site-packages/sane.py", line 142, in __init__
d['dev'] = _sane._open(devname)
NameError: global name '_sane' is not defined

Steps to reproduce:

Just look in the sane.py file in the v2.7.0 sources. It is short enough. ;-)
   PKGBUILD (2.6 KiB)
This task depends upon

Closed by  Kyle Keen (keenerd)
Monday, 23 March 2015, 14:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  python2-pillow-2.7.0-2
Comment by Kyle Keen (keenerd) - Wednesday, 18 March 2015, 17:24 GMT
Thanks. Applied to 2.7.0-2

Two comments though for future bug reports. Private variables should always be prefixed with an underscore. The exact text of the error message is important, but just as important is how the error was caused. In this bug it was trivial, but in more complex situations a test case is greatly appreciated.

While 2.8.0 appears to be working okay I'm going to leave this bug open a few more days in case that change to arr_snap() causes problems. If so the bad call to _open() in 2.7.0 will be patched instead.

Loading...