Bug 144370 - system-logviewer crashes if LANG environment variable not set
system-logviewer crashes if LANG environment variable not set
Product: Fedora
Classification: Fedora
Component: system-logviewer (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Lumens
Depends On:
  Show dependency treegraph
Reported: 2005-01-06 10:57 EST by Kevin Kane
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-01-07 11:12:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Kevin Kane 2005-01-06 10:57:06 EST
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 10:58:54 EST
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 11:12:06 EST
New strategy for determining language:  (1) check $LANG, (2) check
/etc/sysconfig/i18n, (3) default to en_US.UTF-8.  Closed.

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