Bug 144370 - system-logviewer crashes if LANG environment variable not set
Summary: system-logviewer crashes if LANG environment variable not set
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: system-logviewer
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Chris Lumens
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-01-06 15:57 UTC by Kevin Kane
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-01-07 16:12:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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):
system-logviewer-0.9.11-1

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,
configFile,initialView)
  File "/usr/share/system-logviewer/LogViewerGui.py", line 163, in
__init__
    self.initial_read_of_file()
  File "/usr/share/system-logviewer/LogViewerGui.py", line 355, in
initial_read_of_file
    logClassInstance = LogFileClass.LogFileClass(key)
  File "/usr/share/system-logviewer/LogFileClass.py", line 74, in __init__
    self.read_log(self.prefName)
  File "/usr/share/system-logviewer/LogFileClass.py", line 141, in
read_log
    self.buffer.insert_into_buffer_at_offset(iter, line)
  File "/usr/share/system-logviewer/LogBuffer.py", line 71, in
insert_into_buffer_at_offset
    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.


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