Bug 140927 - Language issue when looking for active spooler
Summary: Language issue when looking for active spooler
Status: CLOSED DUPLICATE of bug 131563
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: redhat-config-printer (Show other bugs)
(Show other bugs)
Version: 3.0
Hardware: All Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2004-11-26 15:08 UTC by Patrice Guay
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-11-26 15:59:06 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 15:11 UTC, Patrice Guay
no flags Details | Diff

Description Patrice Guay 2004-11-26 15:08:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.7.3)

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):

How reproducible:

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 ?
  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
    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.


Comment 1 Patrice Guay 2004-11-26 15:11:18 UTC
Created attachment 107484 [details]
Patch to correct this bug

Comment 2 Tim Waugh 2004-11-26 15:59:06 UTC

*** 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.