Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 624458 - net-print/hplip-3.17.6 failed to add printer
Summary: net-print/hplip-3.17.6 failed to add printer
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2017-07-10 14:23 UTC by Pengcheng Xu
Modified: 2017-10-21 18:33 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
trace.log (file_624458.txt,136.47 KB, text/plain)
2017-07-10 14:23 UTC, Pengcheng Xu
Details
gzip-bytes-handling.patch (file_624458.txt,1.02 KB, patch)
2017-07-10 14:34 UTC, nvinson234
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pengcheng Xu 2017-07-10 14:23:38 UTC
Created attachment 482886 [details]
trace.log

hp-setup failed to add my printer (HP LaserJet P1108) saying cannot find PPD file. The command output is as follows while the trace is attached.

 [01mHP Linux Imaging and Printing System (ver. 3.17.6)[0m [01mPrinter/Fax Setup Utility ver. 9.0[0m Copyright (c) 2001-15 HP Development Company, LP This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPYING file for more details. (Note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.) -------------------------------- | SELECT CONNECTION (I/O) TYPE | -------------------------------- Num Connection Description Type -------- ---------- ---------------------------------------------------------- 0* usb Universal Serial Bus (USB) 1 net Network/Ethernet/Wireless (direct connection or JetDirect) [01m Enter number 0...1 for connection type (q=quit, enter=usb*) ? [0m Using connection type: usb [01m Setting up device: hp:/usb/HP_LaserJet_Professional_P1108?serial=000000000Q86SWS3PR1a [0m --------------------- | PRINT QUEUE SETUP | --------------------- [01m Please enter a name for this print queue (m=use model name:'HP_LaserJet_Professional_P1108'*, q=quit) ?[0mUsing queue name: HP_LaserJet_Professional_P1108 Locating PPD file... Please wait. [31;01merror: No PPD found for model laserjet_professional_p1108 using old algorithm.[0m [31;01merror: Unable to find an appropriate PPD file.[0m [01m Would you like to specify the path to the correct PPD file to use (y=yes, n=no*, q=quit) ? [0m[01m Please enter the full filesystem path to the PPD file to use (q=quit) :[0m[31;01merror: File not found or not an appropriate (PPD) file.[0m [01m Please enter the full filesystem path to the PPD file to use (q=quit) :[0mTraceback (most recent call last): File "/usr/bin/hp-setup", line 560, in <module> desc = nickname_pat.search(nickname).group(1) TypeError: can't use a string pattern on a bytes-like object
Comment 1 Pengcheng Xu 2017-07-10 14:28:13 UTC
hmm, sorry for the formatting..

Traceback is as follows. 

Traceback (most recent call last):
  File "/usr/bin/hp-setup", line 560, in <module>
    desc = nickname_pat.search(nickname).group(1)
TypeError: can't use a string pattern on a bytes-like object
Comment 2 nvinson234 2017-07-10 14:34:55 UTC
Created attachment 482888 [details, diff]
gzip-bytes-handling.patch

gzip.GzipReadFile() returns a byte string instead of a text string.  hp-setup then attempts to scan that string using a regex compiled for text strings.  This attempt triggers the traceback.  This patch should fix the issue by decoding the gzip byte string as utf-8 text.
Comment 3 Daniel Pielmeier gentoo-dev 2017-07-14 13:43:23 UTC
Thanks for the patch nvinson234. This patch should really go upstream. Do you mind open this at https://bugs.launchpad.net/hplip
Comment 4 nvinson234 2017-07-15 03:16:09 UTC
(In reply to Daniel Pielmeier from comment #3)
> Thanks for the patch nvinson234. This patch should really go upstream. Do
> you mind open this at https://bugs.launchpad.net/hplip

Actually, I do.  I looked into it because I was handling a tech support issue in #gentoo.  However, other than posting the work I did as part of diagnostics, I don't have any interest in getting back into package maintenance or maintenance-like activities at this time.
Comment 5 Daniel Pielmeier gentoo-dev 2017-07-15 06:36:28 UTC
Reported upstream. Thanks for the report and the patch.
Comment 6 Daniel Pielmeier gentoo-dev 2017-08-17 18:26:38 UTC
According to upstream this should be fixed with hplip-3.17.7. However probably in a different way as hp-setup has seen no changes between 3.17.6 and 3.17.7.

Can you please test if hplip-3.17.7 truly fixes this?
Comment 7 Karl-Johan Karlsson 2017-09-07 19:26:43 UTC
I'm seeing the same error trying to install an HP Color LaserJet MFP M277dw, and the error is present in both 3.17.6 and 3.17.7.
Comment 8 Karl-Johan Karlsson 2017-09-07 19:47:35 UTC
(In reply to Karl-Johan Karlsson from comment #7)
> I'm seeing the same error trying to install an HP Color LaserJet MFP M277dw,
> and the error is present in both 3.17.6 and 3.17.7.

3.17.6 with the patch from comment 2 gets me past this error (and into another, so I still don't have a working printer, but that's unrelated).

However, the patch requires one small change: it's set to apply to "hp-setup", which is just a symlink to "setup.py" (and doesn't even exist yet at src_prepare time). Changing the patch to apply to "setup.py" makes it work.
Comment 9 Daniel Pielmeier gentoo-dev 2017-09-26 18:18:09 UTC
I guess 3.17.9 still does not work. I have asked upstream what's the matter here. So let's see what happens.
Comment 10 Daniel Pielmeier gentoo-dev 2017-09-26 18:39:49 UTC
In the meantime I have added an ebuild (3.17.9-r1) including the patch which should be available soon.