String re bugfix

Asked by Sam Scheele

This bug is associated with the `hp-setup` python script in the hplip project (installed on my Arch Linux machine as /usr/bin/hp-setup). In line 560, you match a regular expression against a variable called "nickname":

desc = nickname_pat.search(nickname).group(1)

However, "nickname" is not a string but rather a bytes object (this is the standard result of calling `read()`). It ought to be decoded. This will fix the issue:

nickname = nickname.decode('utf-8')
desc = nickname_pat.search(nickname).group(1)

Question information

Language:
English Edit question
Status:
Expired
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.