Bug 202964 - Module fails to initialize in Spanish KDE environment
Summary: Module fails to initialize in Spanish KDE environment
Status: RESOLVED FIXED
Alias: None
Product: system-config-printer-kde
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Jonathan Riddell
URL:
Keywords:
: 207433 213419 217137 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-08-07 15:56 UTC by Jonathan Thomas
Modified: 2010-02-12 13:33 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Thomas 2009-08-07 15:56:57 UTC
Version:            (using KDE 4.3.0)
OS:                Linux
Installed from:    Ubuntu Packages

s-p-c-kde bails out with the following traceback when starting in a spanish KDE environment:

jonathan@jonathan-desktop:~$ kcmshell4 system-config-printer-kde                            
Traceback (most recent call last):                                                          
  File "<string>", line 18, in kpythonpluginfactory_bridge                                  
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 4004, in CreatePlugin                                                                        
    kcm = u.makeui(component_data, widget_parent)                                           
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 223, in makeui                                                                               
    special_choice=_("Automatic rotation")),                                                
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 51, in _
    return unicode(i18n(string), "utf-8")
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 6-9: invalid data
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 77, in apport_excepthook
    pr['PythonArgs'] = '%r' % sys.argv
AttributeError: 'module' object has no attribute 'argv'

Original exception was:
Traceback (most recent call last):
  File "<string>", line 18, in kpythonpluginfactory_bridge
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 4004, in CreatePlugin
    kcm = u.makeui(component_data, widget_parent)
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 223, in makeui
    special_choice=_("Automatic rotation")),
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 51, in _
    return unicode(i18n(string), "utf-8")
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 6-9: invalid data
Comment 1 Alexandre Thieme Reis 2009-08-19 03:07:39 UTC
Brazilian portuguese kde too:

kcmshell4 system-config-printer-kde

Traceback (most recent call last):
  File "<string>", line 18, in kpythonpluginfactory_bridge
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 4005, in CreatePlugin
    kcm = u.makeui(component_data, widget_parent)
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 224, in makeui
    special_choice=_("Automatic rotation")),
  File "/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py", line 51, in _
    return unicode(i18n(string), "utf-8")
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 4-6: invalid data

My system:
kubuntu 9.04 with all updates
kde 4.3.0
Comment 2 Andrés Becerra 2009-09-03 18:23:46 UTC
Definitively is a localization bug, if I do:

LC_ALL="en_EN" kcmshell4 system-config-printer-kde

the module loads correctly in my spanish locale.
Comment 3 commat 2009-09-05 19:11:09 UTC
How to fix it.

Edit file:
/usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py

Go to line 223 and ...

Replace -> special_choice=_("Automatic rotation")),
by -> special_choice=i18n("Automatic rotation")),

It works for me.
Comment 4 Andrés Becerra 2009-09-07 23:36:50 UTC
(In reply to comment #3)
> How to fix it.
> 
> Edit file:
> /usr/share/kde4/apps/system-config-printer-kde/system-config-printer-kde.py
> 
> Go to line 223 and ...
> 
> Replace -> special_choice=_("Automatic rotation")),
> by -> special_choice=i18n("Automatic rotation")),
> 
> It works for me.

Definitively, that change fixes the module, thanks.
Comment 5 Alexandre Thieme Reis 2009-09-08 07:12:14 UTC
Work for me too!
Comment 6 Kamil Neczaj 2009-09-13 14:39:30 UTC
Solution from comment #3 works for me.
Comment 7 Jonathan Riddell 2009-10-13 15:30:57 UTC
SVN commit 1034769 by jriddell:

this seems to fix crashes when using translations
strings in pyqt are weird :(
BUG:202964


 M  +1 -1      system-config-printer-kde.py  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1034769
Comment 8 Andrea Scarpino 2009-11-06 15:03:39 UTC
*** Bug 213419 has been marked as a duplicate of this bug. ***
Comment 9 Jonathan Thomas 2009-12-22 03:31:35 UTC
*** Bug 217137 has been marked as a duplicate of this bug. ***
Comment 10 Burkhard Lück 2010-02-12 13:33:16 UTC
*** Bug 207433 has been marked as a duplicate of this bug. ***