Bug 1017561 - [abrt] system-config-printer-1.4.2-1.fc19: newprinter.py:2683:on_tvNPDevices_cursor_changed:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 44: ordinal not in range(128)
[abrt] system-config-printer-1.4.2-1.fc19: newprinter.py:2683:on_tvNPDevices_...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: system-config-printer (Show other bugs)
19
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
abrt_hash:9dd32a55a187b62c1c5606d077f...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-10 03:43 EDT by Terry Moschou
Modified: 2013-11-10 02:44 EST (History)
3 users (show)

See Also:
Fixed In Version: system-config-printer-1.4.3-2.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-06 02:39:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
File: backtrace (1.16 KB, text/plain)
2013-10-10 03:43 EDT, Terry Moschou
no flags Details
File: environ (2.23 KB, text/plain)
2013-10-10 03:43 EDT, Terry Moschou
no flags Details

  None (edit)
Description Terry Moschou 2013-10-10 03:43:23 EDT
Description of problem:
Started system-config-printer from kickoff KDE.
Actually there are several printer config menu items for some reason.
I believe the one I chose corresponds to 
/usr/share/applications/system-config-printer.desktop
from package 'system-config-printer-1.4.2-1.fc19.x86_64'
the other was 
/usr/share/kde4/services/kcm_printer_manager.desktop
from package 'kde-print-manager-4.11.1-1.fc19.x86_64'

Went to add new printer
Authenticated as admin, twice.
First case:
  System policy prevents to change the firewall configuration
  Action: Firewall configuration
  Vendor: FirewallD
Second case:
  Privileges are required to get list of available devices
  Action: Get list of available devices
  Vendor: The openSUSE Project

openSUSE? should that be right?

Under Devices->Network Printer several entries marked 'None' appeared after a while.
I sellected one of them, before the error occured.

Version-Release number of selected component:
system-config-printer-1.4.2-1.fc19

Additional info:
reporter:       libreport-2.1.7
cmdline:        /usr/bin/python /usr/share/system-config-printer/system-config-printer.py
dso_list:       system-config-printer-libs-1.4.2-1.fc19.noarch
executable:     /usr/share/system-config-printer/system-config-printer.py
kernel:         3.11.3-201.fc19.x86_64
runlevel:       N 5
type:           Python
uid:            1000

Truncated backtrace:
newprinter.py:2683:on_tvNPDevices_cursor_changed:UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 44: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/share/system-config-printer/newprinter.py", line 2683, in on_tvNPDevices_cursor_changed
    device.menuentry += " (%s)" % device.info
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 44: ordinal not in range(128)

Local variables in innermost frame:
widget: <TreeView object at 0x306fa00 (GtkTreeView at 0x320c4b0)>
name: u'HP%20Photosmart%20C4400%20series%20%40%20Devin%20Methven%E2%80%99s%20MacBook%20Pro._ipp._tcp.local'
column: <TreeViewColumn object at 0x3ccc870 (GtkTreeViewColumn at 0x345a4b0)>
cupsqueue: u'cups'
self: <NewPrinterGUI object at 0x306f500 (newprinter+NewPrinterGUI at 0x32916a0)>
rest: None
physicaldevice: <PhysicalDevice.PhysicalDevice (Photosmart,C4400,)>
iter: <GtkTreeIter at 0x3e4ad00>
device: <cupshelpers.Device "dnssd://HP%20Photosmart%20C4400%20series%20%40%20Devin%20Methven%E2%80%99s%20MacBook%20Pro._ipp._tcp.local/cups">
path: <GtkTreePath at 0x38f97a0>
model: <TreeStore object at 0x3ce8960 (GtkTreeStore at 0x3586b90)>
scheme: u'dnssd'
Comment 1 Terry Moschou 2013-10-10 03:43:28 EDT
Created attachment 810349 [details]
File: backtrace
Comment 2 Terry Moschou 2013-10-10 03:43:32 EDT
Created attachment 810350 [details]
File: environ
Comment 3 Jiri Popelka 2013-10-10 10:21:15 EDT
(In reply to Terry Moschou from comment #0)
>   Vendor: The openSUSE Project
> openSUSE? should that be right?

That's correct, yes. cups-pk-helper originates from openSUSE.
http://www.vuntz.net/journal/post/2010/02/19/A-few-words-about-cups-pk-helper...
 
> Under Devices->Network Printer several entries marked 'None' appeared after
> a while. I sellected one of them, before the error occured.

Hmm, I don't remember ever seeing any 'None' entries there.

>     device.menuentry += " (%s)" % device.info
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 44:
> ordinal not in range(128)

Means that device.menuentry was unicode while device.info was (utf-8) encoded,
I'll check what can be done here.
Comment 5 Nathanael Noblet 2013-10-16 20:22:30 EDT
doesn't seem to fix it for me. (I manually edited that line (2685) in a similar way and I got 

device.menuentry += " (%s)" % [ device.info('utf-8') if isinstance(w,bytes) else w for w in device.info ]
TypeError: 'str' object is not callable

Probably did it wrong however I also applied the patch linked to above. Still no go.
Comment 6 Jiri Popelka 2013-10-17 03:41:14 EDT
I actually made one more commit later.
https://git.fedorahosted.org/cgit/system-config-printer.git/commit/?id=856349f18be42f0c95e1f021c348d4858e54a1f3

Would be great if you could try it too.
You can simply replace
/usr/share/system-config-printer/newprinter.py
with
https://git.fedorahosted.org/cgit/system-config-printer.git/plain/newprinter.py

If that doesn't help I'll add some debug outputs so we can see what is actually going on there.
Comment 7 Nathanael Noblet 2013-10-17 10:55:05 EDT
So after struggling with it for a bit I renamed the computer that was advertising the printer and this solved the issue. Its an iMac so they do some stupid "Soand-So's-iMac" naming convention. My guess is that the apostrophe is one of those odd apostrophe's similar to the ones MS uses the 'Smart/Curly' apostrophe. Anyway I'll rename the computer and try out your file and report back.
Comment 8 Fedora Update System 2013-10-22 12:55:43 EDT
system-config-printer-1.4.3-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/system-config-printer-1.4.3-1.fc20
Comment 9 Fedora Update System 2013-10-22 12:58:02 EDT
system-config-printer-1.4.3-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/system-config-printer-1.4.3-1.fc19
Comment 10 Fedora Update System 2013-10-22 23:30:44 EDT
Package system-config-printer-1.4.3-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing system-config-printer-1.4.3-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-19726/system-config-printer-1.4.3-1.fc19
then log in and leave karma (feedback).
Comment 11 Fedora Update System 2013-11-06 02:39:17 EST
system-config-printer-1.4.3-2.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 12 Fedora Update System 2013-11-10 02:44:15 EST
system-config-printer-1.4.3-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

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