On Sat, 21 Sep 2019 14:07:18 +0200 Didier 'OdyX' Raboud wrote:
> Le samedi, 21 septembre 2019, 10.53:04 h CEST Francesco Poli a écrit :
> > Should we suppose that printer-driver-hpcups reads /etc/os-release
> > (or /etc/issue* or /etc/debian_version) and decides whether it will
> > crash, based on this?!?
>
> Well. Parts of hplip are in python; and hplip then uses:
>
> import platform
> dist = platform.dist()
>
> platform.dist() will try to guess the Linux distro from /etc/lsb-release
> (should not exist), then /etc/*-{release,version}, hence /etc/os-release.
Ah. This looks really surprising to me...
>
> hplip uses its own internal list of supported distros, in
> /usr/share/hplip/installer/distros.dat
> … shipped from hplip-data.
[...]
> I'm not sure it will work, as printer-driver-hpcups doesn't depend on hplip-
> data anyway; *sigh*.
And indeed, I do not have hplip-data installed:
$ apt policy hplip-data
hplip-data:
Installed: (none)
Candidate: 3.19.8+dfsg0-1
Version table:
3.19.8+dfsg0-3 500
500 http://deb.debian.org/debian unstable/main i386 Packages
3.19.8+dfsg0-1 800
800 http://deb.debian.org/debian testing/main i386 Packages
$ apt policy printer-driver-hpcups
printer-driver-hpcups:
Installed: 3.19.8+dfsg0-1
Candidate: 3.19.8+dfsg0-1
Version table:
3.19.8+dfsg0-3 500
500 http://deb.debian.org/debian unstable/main i386 Packages
*** 3.19.8+dfsg0-1 800
800 http://deb.debian.org/debian testing/main i386 Packages
100 /var/lib/dpkg/status
>
> (It seems this whole "detect the distro and try being smart" should be
> removed
> completely from Debian's hplip).
Well, I retested the setup with the driver that was crashing on my box.
I am no longer able to reproduce the bug (without even having to
downgrade base-files!).
# lpadmin -x lj
# lpadmin -p lj -E \
> -v 'usb://HP/LaserJet%201320%20series?serial=00CNFW522KS9' \
> -m drv:///hpijs.drv/hp-laserjet_1320-hpijs.ppd \
> -o pdftops-renderer-default=pdftops \
> -L local -D "HP LaserJet 1320"
lpadmin: Printer drivers are deprecated and will stop working in a future
version of CUPS.
# lpoptions -p lj -o media=A4 -o sides=two-sided-long-edge
# lpadmin -d lj
$ apt policy base-files
base-files:
Installed: 11
Candidate: 11
Version table:
*** 11 800
800 http://deb.debian.org/debian testing/main i386 Packages
500 http://deb.debian.org/debian unstable/main i386 Packages
100 /var/lib/dpkg/status
$ python
Python 2.7.16+ (default, Sep 4 2019, 08:19:57)
[GCC 9.2.1 20190827] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> dist = platform.dist()
>>> dist
('debian', 'bullseye/sid', '')
>>>
$ python3
Python 3.7.4+ (default, Sep 4 2019, 08:03:05)
[GCC 9.2.1 20190827] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> dist = platform.dist()
__main__:1: DeprecationWarning: dist() and linux_distribution() functions are
deprecated in Python 3.5
>>> dist
('debian', 'bullseye/sid', '')
>>>
$ echo hello | lpr
$ lpq
lj is ready and printing
Rank Owner Job File(s) Total Size
active USER 368 (stdin) 1024 bytes
$ lpq
lj is ready
no entries
It works with no issues: I got a wonderful (well, sort of wonderful...)
page with the "hello" string printed on one of its sides...
Unless I am misinterpreting something, this bug seems to have vanished
or have been fixed in printer-driver-hpcups/3.19.8+dfsg0-1
I do not understand why other users seem to get different experiences...
--
http://www.inventati.org/frx/
There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
GnuPG key fpr == CA01 1147 9CD2 EFDF FB82 3925 3E1C 27E1 1F69 BFFE
pgpXvaISmkmrT.pgp
Description: PGP signature
