networked scanners not working with python2.4 sane
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-imaging (Ubuntu) |
Fix Released
|
Undecided
|
Matthias Klose |
Bug Description
Binary package hint: python-imaging-sane
The python2.4 sane module doesn't appear to work with networked scanners under edgy.
Python2.5 appears to be fine.
An attempt from 2.4 to access a scanner.
jamest@floyd:~$ python
Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sane
>>> print 'SANE version:', sane.init()
SANE version: (16777234, 1, 0, 18)
>>> scanner=
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/
new=
File "/usr/lib/
d['
File "/usr/lib/
raise RuntimeError('no scanner available')
RuntimeError: no scanner available
>>>
Now the same attempt from python2.5
jamest@floyd:~$ python2.5
Python 2.5 (r25:51908, Oct 6 2006, 15:22:41)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sane
>>> print 'SANE version:', sane.init()
SANE version: (16777234, 1, 0, 18)
>>> scanner=
>>> print 'SaneDev object=', scanner
SaneDev object= <sane.SaneDev instance at 0xb7d1356c>
>>>
Seems to reappear in Feisty (never tested the problem under Edgy myself).
Attached is a fix. The problem is there isn't an initial value for the optional variable local_only in PySane_ get_devices( ). So, when sane.get_devices() is called without an argument (like it is through sane.open()), the value of local_only will be arbitrary leading to local only operation with high probability.
Jason Parekh