Bug 140927 - Language issue when looking for active spooler
Language issue when looking for active spooler
Status: CLOSED DUPLICATE of bug 131563
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: redhat-config-printer (Show other bugs)
3.0
All Linux
medium Severity high
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-26 10:08 EST by Patrice Guay
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-26 10:59:06 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)
Patch to correct this bug (2.02 KB, patch)
2004-11-26 10:11 EST, Patrice Guay
no flags Details | Diff

  None (edit)
Description Patrice Guay 2004-11-26 10:08:59 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.7.3)
Gecko/20040910

Description of problem:
When the LANG locale is set to something else than "C", "en" or any
"en_XX", redhat-print-config and redhat-config-printer-gui will not work. 

This issue is caused by the following command in Python scripts:
       signal.signal (signal.SIGCHLD, signal.SIG_DFL)
->     f = os.popen ('/usr/sbin/alternatives --display print')
       for l in f.readlines ():
           if l.startswith (" link currently points to"):
               which = l.split ('.')[1].strip ()

The output of '/usr/sbin/alternatives --display print' may not be in
English. To correct this problem, one should use instead:`
       signal.signal (signal.SIGCHLD, signal.SIG_DFL)
->     f = os.popen ('LANG=C /usr/sbin/alternatives --display print')
       for l in f.readlines ():
           if l.startswith (" link currently points to"):
               which = l.split ('.')[1].strip ()

Those lines are found in 3 different scripts:
 - /usr/share/printconf/util/cups_import.py
 - /usr/share/printconf/util/printconf_conf.py
 - /usr/share/printconf/util/queueTree.py

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

How reproducible:
Always

Steps to Reproduce:
1. lang=fr_CA redhat-config-print
    

Actual Results:  The program crash and outputs:

Traceback (most recent call last):
  File "/usr/sbin/printconf", line 9, in ?
    import queueTree
  File "/usr/share/printconf/util/queueTree.py", line 945, in ?
    queueTree()
  File "/usr/share/printconf/util/queueTree.py", line 222, in __init__
    self.active_spooler = self.get_active_spooler ()
  File "/usr/share/printconf/util/queueTree.py", line 243, in
get_active_spooler
    return which
UnboundLocalError: local variable 'which' referenced before assignment


Expected Results:  A GUI should appear. I should be able to configure
my printer via this GUI.

Additional info:

The solution for this bug was submitted by Juan Carlos Castro y Castro
<jcastro@gisplan.com.br> in the Tao-discuss mailing list.

http://mailman.taolinux.org/pipermail/tao-discuss/2004-November/000702.html
Comment 1 Patrice Guay 2004-11-26 10:11:18 EST
Created attachment 107484 [details]
Patch to correct this bug
Comment 2 Tim Waugh 2004-11-26 10:59:06 EST

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

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