Bug 138290

Summary: redhat-config-printer crashes with LANG=de_DE
Product: Red Hat Enterprise Linux 3 Reporter: Joachim Jaeckel <bugzilla-2004>
Component: redhat-config-printerAssignee: Tim Waugh <twaugh>
Status: CLOSED DUPLICATE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: redhat-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 19:06:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joachim Jaeckel 2004-11-07 16:19:18 UTC
Description of problem:
on a system with a non-standard language setting, e.g. LANG=de_DE
redhat-config-printer crashes with python traceback.

Version-Release number of selected component (if applicable):
redhat-config-printer-0.6.47.3.19-1

How reproducible:
Every time

Steps to Reproduce:
1. be root
2. export LANG=de_DE
3. redhat-config-printer
  
Actual results:
Traceback (most recent call last):
  File "/usr/sbin/redhat-config-printer", line 9, in ?
    import queueTree
  File "/usr/share/printconf/util/queueTree.py", line 945, in ?
    queueTree()
  File "/usr/share/printconf/util/queueTree.py", line 102, in __init__
    if cups_import.import_needed ():
  File "/usr/share/printconf/util/cups_import.py", line 200, in 
import_needed
    which = which_spooler ()
  File "/usr/share/printconf/util/cups_import.py", line 195, in 
which_spooler
    return which
UnboundLocalError: local variable 'which' referenced before assignment


Expected results:
Printer configuration window appears

Additional info:
similar errormessage appears at boot time from /etc/rc3.d/S55cups
on a system with LANG="de_DE" in /etc/sysconfig/i18n

Reason of this problem:
file /usr/share/printconf/util/cups_import.py" lines 188 - 190
calls '/usr/sbin/alternatives --display print' and looks for the
string " link currently points to". If you do not use the standart
language in your system, this string will not be found.
Same construction in two other files in /usr/share/printconf/util/

Workaround:
file /usr/share/printconf/util/cups_import.py line 188
file /usr/share/printconf/util/printconf_conf.py line 1049
file /usr/share/printconf/util/queueTree.py line 236
change
   f = os.popen ('/usr/sbin/alternatives --display print')
to
   f = os.popen ('LC_ALL=C /usr/sbin/alternatives --display print')

Comment 1 Robert Scheck 2004-11-07 22:50:25 UTC
Jupp, I've got the same problem at work using U3 for example, it would 
be very nice to get a official fix with a rpm update for U4.

Comment 2 Tim Waugh 2004-11-08 16:06:24 UTC

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

Comment 3 Red Hat Bugzilla 2006-02-21 19:06:49 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.