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
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
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.
Thanks for the patch nvinson234. This patch should really go upstream. Do you mind open this at https://bugs.launchpad.net/hplip
(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.
Reported upstream. Thanks for the report and the patch.
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?
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.
(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.
I guess 3.17.9 still does not work. I have asked upstream what's the matter here. So let's see what happens.
In the meantime I have added an ebuild (3.17.9-r1) including the patch which should be available soon.