'hp-setup -i' crashes with traceback if user want to supply path to PPD

Bug #1814272 reported by zdohnal
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

Hi,

one user of Fedora found out the bug in hp-setup - when user tries to add path to PPD file (a printer is discovered, the script finds the ppd, but user wants to use different), the script fails with traceback:

Traceback (most recent call last):
  File "/usr/bin/hp-setup", line 560, in <module>
    desc = nickname_pat.search(nickname).group(1)
TypeError: cannot use a string pattern on a bytes-like object

It is caused by incompatibility of types - 'nickname' is byte object and 'nickname_pat' is string object, so the fix is to decode 'nickname' to string object. I attached the patch.

Would you mind adding the patch to the project?

Have a nice day,

Zdenek

Tags: patch
Revision history for this message
zdohnal (zdohnal) wrote :
Revision history for this message
lutzke (lutzke) wrote :

This bug affects me as well. It's preventing me from installing my printer. It is frustrating to see that this bug, and a proposed fix, have been around for over a year with no fix.

Revision history for this message
zdohnal (zdohnal) wrote :

I moved the added lines to be applied only when the file is gzipped. If it is a clean ppd, it led to traceback.

It works fine now with the newest patch, for gzipped PPD and decompressed too.

Revision history for this message
zdohnal (zdohnal) wrote :

Even adding PPD in GUI now works with this patch (GUI hp-setup uses completely different code...).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.