UnicodeDecodeError in utils.py", line 959 when configuring printer with non-ascii company name

Bug #487268 reported by Frederik Himpe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

Original Mandriva bug report: https://qa.mandriva.com/show_bug.cgi?id=55919

The user sets up a HP LaserJet M2727nf MFP printer and enters non-ascii characters in the company name of the fax.

Then he tries to configure the printer on his Mandriva system by using hp-setup. hp-setup crashes with this backtrace:

The installation aborts with the following errors:
Traceback (most recent call last):
  File "/usr/share/hplip/ui4/setupdialog.py", line 1220, in NextButton_clicked
    self.showAddPrinterPage()
  File "/usr/share/hplip/ui4/setupdialog.py", line 678, in showAddPrinterPage
    self.readwriteFaxInformation()
  File "/usr/share/hplip/ui4/setupdialog.py", line 1043, in
readwriteFaxInformation
    self.fax_number = unicode(d.getPhoneNum())
  File "/usr/share/hplip/fax/soapfax.py", line 132, in getPhoneNum
    fax_setup = utils.XMLToDictParser().parseXML(stream.getvalue())
  File "/usr/share/hplip/base/utils.py", line 959, in parseXML
    parser.Parse(text.encode('utf-8'), True)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 313:
ordinal not in range(128)

The user says that replacing line 959 of utils.py
parser.Parse(text.encode('utf-8'), True)
by
parser.Parse(text, True)
fixes the problem.

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.