Bug 1028992

Summary: [abrt] hplip-3.13.9-2.fc19: device.py:821:parseDeviceURI:UnicodeEncodeError: 'ascii' codec can't encode character u'\xba' in position 1: ordinal not in range(128)
Product: [Fedora] Fedora Reporter: Marco Silva <sms_advogados>
Component: hplipAssignee: Tim Waugh <twaugh>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: jpopelka, sms_advogados, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/c15d0d9c09ca6c0cbdde50e5cf5b9b35fa86b9ee
Whiteboard: abrt_hash:7502bb21e50791c4221d882a602b0cc32546de24
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-19 09:51:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Marco Silva 2013-11-11 12:41:14 UTC
Version-Release number of selected component:
hplip-3.13.9-2.fc19

Additional info:
reporter:       libreport-2.1.9
cmdline:        /usr/bin/python /usr/bin/hp-setup --gui
dso_list:       hplip-gui-3.13.9-2.fc19.x86_64
executable:     /usr/bin/hp-setup
kernel:         3.11.6-201.fc19.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
device.py:821:parseDeviceURI:UnicodeEncodeError: 'ascii' codec can't encode character u'\xba' in position 1: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/share/hplip/ui4/setupdialog.py", line 1239, in NextButton_clicked
    self.addPrinter()
  File "/usr/share/hplip/ui4/setupdialog.py", line 948, in addPrinter
    self.setupFax()
  File "/usr/share/hplip/ui4/setupdialog.py", line 1004, in setupFax
    self.installed_fax_devices = device.getSupportedCUPSDevices(['hpfax'])
  File "/usr/share/hplip/base/device.py", line 658, in getSupportedCUPSDevices
    parseDeviceURI(p.device_uri)
  File "/usr/share/hplip/base/device.py", line 821, in parseDeviceURI
    m = pat_deviceuri.match(device_uri)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xba' in position 1: ordinal not in range(128)

Local variables in innermost frame:
device_uri: 'hp:/net/HP_LaserJet_P4015?zc=NPI15EE9E'

Comment 1 Marco Silva 2013-11-11 12:41:24 UTC
Created attachment 822382 [details]
File: backtrace

Comment 2 Marco Silva 2013-11-11 12:41:27 UTC
Created attachment 822383 [details]
File: environ

Comment 3 Jiri Popelka 2013-11-11 14:03:42 UTC
Hmmm, no idea what went wrong, the following code works ok and I don't actually see any non-ascii characters involved:

pat_deviceuri = re.compile(r"""(.*):/(.*?)/(\S*?)\?(?:serial=(\S*)|device=(\S*)|ip=(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}[^&]*)|zc=(\S+)|hostname=(\S+))(?:&port=(\d))?""", re.IGNORECASE)
device_uri = 'hp:/net/HP_LaserJet_P4015?zc=NPI15EE9E'
m = pat_deviceuri.match(device_uri)

Comment 4 Tim Waugh 2013-11-18 12:44:31 UTC
The only reason I can imagine for this trace is that hp-setup was started and still running while the hplip packages were upgraded.

Marco: are you able to get this to happen again, or did it happen only once? What does 'rpm -q --last hplip-gui' say?

Comment 5 Marco Silva 2013-11-18 18:05:59 UTC
I tried to reproduce the problem, but wasn't able to.

It seems to have hapenned once, when I was adding a printer.

rpm -q --last hplip-gui says:

hplip-gui-3.13.9-2.fc19.x86_64                Sex 01 Nov 2013 13:36:33 WET

Please let me know if you need anything else

Comment 6 Tim Waugh 2013-11-19 09:51:05 UTC
\xba isn't even a valid first UTF-8 byte (it would have to be a continuation byte), so I really don't know what happened here. Without being able to reproduce it, I'm out of ideas.

Please re-open if you see this happen again.