Bug 144370

Summary: system-logviewer crashes if LANG environment variable not set
Product: [Fedora] Fedora Reporter: Kevin Kane <kckane>
Component: system-logviewerAssignee: Chris Lumens <clumens>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-01-07 16:12:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Kevin Kane 2005-01-06 15:57:06 UTC
Description of problem:
The system-logviewer application crashes with a Python error if the
LANG environment variable is not set. The trace is included below.

Version-Release number of selected component (if applicable):

How reproducible:
Every time.

Steps to Reproduce:
1. open a terminal window
2. unset LANG
2. system-logviewer
Actual results:

Traceback (most recent call last):
  File "/usr/share/system-logviewer/system-logviewer.py", line 80, in ?
    LogViewerGui.LogViewerGui(width,height, allowConfigChanges,
  File "/usr/share/system-logviewer/LogViewerGui.py", line 163, in
  File "/usr/share/system-logviewer/LogViewerGui.py", line 355, in
    logClassInstance = LogFileClass.LogFileClass(key)
  File "/usr/share/system-logviewer/LogFileClass.py", line 74, in __init__
  File "/usr/share/system-logviewer/LogFileClass.py", line 141, in
    self.buffer.insert_into_buffer_at_offset(iter, line)
  File "/usr/share/system-logviewer/LogBuffer.py", line 71, in
    langEnVar = os.environ["LANG"]
  File "/usr/lib/python2.3/UserDict.py", line 19, in __getitem__
    def __getitem__(self, key): return self.data[key]
KeyError: 'LANG'

Expected results:
The log viewer window to appear.

Additional info:
I do not recall having this issue with the original FC3 installation,
 it occurred just after I had applied the latest FC3 updates. Note
that my FC3 is an upgrade of RHL9.

Comment 1 Kevin Kane 2005-01-06 15:58:54 UTC
Just to clear, if you export LANG=something prior to running
system-logviewer then the window will come up just fine.

Comment 2 Chris Lumens 2005-01-07 16:12:06 UTC
New strategy for determining language:  (1) check $LANG, (2) check
/etc/sysconfig/i18n, (3) default to en_US.UTF-8.  Closed.