Bug 1108903 - [abrt] system-config-printer: PhysicalDevice.py:199:get_info:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 55: ordinal not in range(128)
Summary: [abrt] system-config-printer: PhysicalDevice.py:199:get_info:UnicodeDecodeErr...
Keywords:
Status: CLOSED DUPLICATE of bug 968142
Alias: None
Product: Fedora
Classification: Fedora
Component: system-config-printer
Version: 20
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:4100211dde34f38d35a15ca656e...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-12 19:26 UTC by Peter H. Jones
Modified: 2014-06-13 10:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 10:07:43 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1.25 KB, text/plain)
2014-06-12 19:26 UTC, Peter H. Jones
no flags Details
File: dso_list (78 bytes, text/plain)
2014-06-12 19:26 UTC, Peter H. Jones
no flags Details
File: environ (1.56 KB, text/plain)
2014-06-12 19:26 UTC, Peter H. Jones
no flags Details

Description Peter H. Jones 2014-06-12 19:26:19 UTC
Description of problem:
Trying to install a Brother HL-2270DW printer on a USB port. Problem happened after I detected and selected the printer, before the search for drivers began.

Version-Release number of selected component:
system-config-printer-1.4.4-1.fc20

Additional info:
reporter:       libreport-2.2.2
cmdline:        /usr/bin/python /usr/share/system-config-printer/system-config-printer.py
executable:     /usr/share/system-config-printer/system-config-printer.py
kernel:         3.14.6-200.fc20.x86_64
runlevel:       N 5
type:           Python
uid:            3000

Truncated backtrace:
PhysicalDevice.py:199:get_info:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 55: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 604, in msg_reply_handler
    reply_handler(*message.get_args_list(**get_args_opts))
  File "/usr/share/system-config-printer/dnssdresolve.py", line 107, in _reply
    self._resolved ()
  File "/usr/share/system-config-printer/dnssdresolve.py", line 93, in _resolved
    self._reply_handler (self._devices)
  File "/usr/share/system-config-printer/newprinter.py", line 1779, in <lambda>
    devices))
  File "/usr/share/system-config-printer/newprinter.py", line 1782, in dnssd_resolve_reply
    self.add_devices (devices, current_uri, no_more=True)
  File "/usr/share/system-config-printer/newprinter.py", line 2136, in add_devices
    info = device.get_info ()
  File "/usr/share/system-config-printer/PhysicalDevice.py", line 199, in get_info
    info.find(self._network_host) == -1) and \
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 55: ordinal not in range(128)

Local variables in innermost frame:
info: 'HP LaserJet P2015 Series (209DF5) @ Ordinateur de Montr\xc3\xa9al Cam'
self: <PhysicalDevice.PhysicalDevice (,,)>

Comment 1 Peter H. Jones 2014-06-12 19:26:23 UTC
Created attachment 908266 [details]
File: backtrace

Comment 2 Peter H. Jones 2014-06-12 19:26:25 UTC
Created attachment 908267 [details]
File: dso_list

Comment 3 Peter H. Jones 2014-06-12 19:26:27 UTC
Created attachment 908268 [details]
File: environ

Comment 4 Peter H. Jones 2014-06-12 19:34:08 UTC
After the search for drivers ended, I was presented with a list of printers. When I selected Brother, 2270 was not in the HL section of the list, with or without the hyphen. On this machine, I haven't installed the rpms from Brother.

Comment 5 Jiri Popelka 2014-06-13 07:58:34 UTC
(In reply to Peter H. Jones from comment #0)
>   File "/usr/share/system-config-printer/PhysicalDevice.py", line 199, in
> get_info
>     info.find(self._network_host) == -1) and \
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 55:
> ordinal not in range(128)
> 
> Local variables in innermost frame:
> info: 'HP LaserJet P2015 Series (209DF5) @ Ordinateur de Montr\xc3\xa9al Cam'

info.find(self._network_host) fails because 'info' is (utf-8) encoded and self._network_host is most likely unicode.

The only idea I have is to remove
        if type (host) == unicode:
            host = host.encode ('utf-8')
        if type (dnssdhost) == unicode:
            dnssdhost = dnssdhost.encode ('utf-8')
from _get_host_from_uri() but it might as well cause other issues as I don't see which strings are unicode and which are encoded.

These problems started to appear with python-2.7 and will hopefully be solved with switching to python-3 in system-config-printer-1.5

Comment 6 Jiri Popelka 2014-06-13 10:07:43 UTC

*** This bug has been marked as a duplicate of bug 968142 ***


Note You need to log in before you can comment on or make changes to this bug.