[linux] elisa doesn't start if LANG=C

Bug #264394 reported by Philippe Normand
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Moovida
Fix Released
Critical
Philippe Normand

Bug Description

Steps to reproduce:

1. Launch elisa from command-line: LANG=C elisa

Expected result: you see Elisa in english
Current result: you see the following traceback (in english, however):

WARN MainThread interface_controller Sep 03 12:11:44 creating frontend frontend1 failed. A full traceback can be found at [Failure instance: Traceback: <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'lower'
/usr/lib/python2.5/site-packages/twisted/internet/defer.py:182:addCallbacks
/usr/lib/python2.5/site-packages/twisted/internet/defer.py:317:_runCallbacks
/usr/lib/python2.5/site-packages/elisa/plugins/pigment/pigment_frontend.py:432:frontend_initialized
/usr/lib/python2.5/site-packages/elisa/plugins/pigment/pigment_frontend.py:116:create_controller
--- <exception caught here> ---
/usr/lib/python2.5/site-packages/elisa/core/plugin_registry.py:384:create_component
/usr/lib/python2.5/site-packages/twisted/python/reflect.py:357:namedAny
/usr/lib/python2.5/site-packages/elisa/plugins/poblesec/main.py:30:<module>
/usr/lib/python2.5/site-packages/elisa/core/utils/i18n.py:92:install_translation
/usr/lib/python2.5/gettext.py:465:translation
/usr/lib/python2.5/gettext.py:437:find
/usr/lib/python2.5/gettext.py:132:_expand_lang
/usr/lib/python2.5/locale.py:296:normalize
] (elisa/core/interface_controller.py:88)
WARN MainThread interface_controller Sep 03 12:11:44 Could not load any frontend (elisa/core/interface_controller.py:123)

Philippe Normand (philn)
Changed in elisa:
milestone: none → 0.5.x
description: updated
Revision history for this message
Florian Boucault (fboucault) wrote :

I can reproduce it with Elisa 0.5.22 on Ubuntu Intrepid.

Changed in elisa:
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Paul van Tilburg (paulvt) wrote :

Still reproducable with Elisa 0.5.30 on Debian.

Olivier Tilloy (osomon)
Changed in elisa:
milestone: 0.5.x → none
Revision history for this message
pancake (pancake) wrote :

Patch to fix this problem:

=== modified file 'elisa-core/elisa/core/utils/i18n.py'
--- elisa-core/elisa/core/utils/i18n.py 2009-01-22 12:55:24 +0000
+++ elisa-core/elisa/core/utils/i18n.py 2009-03-05 19:09:35 +0000
@@ -82,6 +82,8 @@
         current_locale = lang
     else:
         current_locale = locale.getdefaultlocale()[0]
+ if current_locale is None:
+ current_locale = 'C'
     return current_locale

 def install_translation(plugin_name):

Revision history for this message
Olivier Tilloy (osomon) wrote :

The patch format is weird (looks like it's missing some whitespaces for a correct indentation), but it fixes the issue.
However assuming 'C' by default without looking at the value of $LANG looks wrong to me.
And as this is a change to the core, a complete patch needs a unit test.

Olivier Tilloy (osomon)
Changed in elisa:
milestone: none → 0.5.34
Philippe Normand (philn)
Changed in elisa:
assignee: nobody → philn
status: Confirmed → In Progress
Olivier Tilloy (osomon)
Changed in elisa:
milestone: 0.5.34 → 0.5.35
Philippe Normand (philn)
Changed in elisa:
status: In Progress → Fix Committed
Olivier Tilloy (osomon)
Changed in elisa:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.