weird LANGUAGE environment variable values cause checkbox to malfunction

Bug #912946 reported by Daniel Manrique
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Low
Daniel Manrique

Bug Description

On several installations (server, and a few where some packages got damaged and language support was not configured correctly), I've seen LANGUAGE with values like this:

LANGUAGE=en_US:

checkbox parses splitting on the colon character, and tries to process the (in this case) empty value, causing the following output to the log:
2012-01-06 17:04:37,800 ERROR Error running event handler ./plugins/message_info.py MessageInfo.message_file(<open file './jobs/disk.txt.in', mode 'r' at 0x20bd540>, ./jobs/disk.txt.in) for event type 'message-file'
Traceback (most recent call last):
  File "/home/roadmr/Documents/checkboxes/language/checkbox/reactor.py", line 74, in fire
    results.append(handler(*args, **kwargs))
  File "./plugins/message_info.py", line 85, in message_file
    template = TemplateI18n()
  File "/home/roadmr/Documents/checkboxes/language/checkbox/lib/template_i18n.py", line 33, in __init__
    self._languages = self._get_languages()
  File "/home/roadmr/Documents/checkboxes/language/checkbox/lib/template_i18n.py", line 80, in _get_languages
    languages.extend(self._get_language_list(language))
  File "/home/roadmr/Documents/checkboxes/language/checkbox/lib/template_i18n.py", line 56, in _get_language_list
    raise Exception, "Unknown language format: %s" % language
Exception: Unknown language format:

The user-facing consequence is that the list of tests to run is completely empty.

The correct format for LANGUAGE is something like:

LANGUAGE=en_US:en

To reproduce, run checkbox setting the variable to something invalid:

LANGUAGE=en_US: checkbox-gtk

Expected result:
a nice list of tests to choose from.

Actual result:
previously mentioned trace, and test selection list is empty.

The easy workaround is to set LANGUAGE to something sensible before running checkbox. Still, I'll submit a merge request with a fix for this.

Related branches

Revision history for this message
Marc Tardif (cr3) wrote :

Marked importance as low because the likeliness of someone setting an invalid value for the LANGUAGE environment variable is rather low.

Changed in checkbox:
status: New → Fix Committed
assignee: nobody → Daniel Manrique (roadmr)
importance: Undecided → Low
Revision history for this message
Jeff Lane  (bladernr) wrote : Re: [Bug 912946] Re: weird LANGUAGE environment variable values cause checkbox to malfunction

On 01/06/2012 05:28 PM, Marc Tardif wrote:
> Marked importance as low because the likeliness of someone setting an
> invalid value for the LANGUAGE environment variable is rather low.
>
> ** Changed in: checkbox
> Status: New => Fix Committed
>
> ** Changed in: checkbox
> Assignee: (unassigned) => Daniel Manrique (roadmr)
>
> ** Changed in: checkbox
> Importance: Undecided => Low

This has happened before... I'm thinking I saw this in Natty, perhaps...
there was a bug opened but I can't find it now. It was an ubuntu bug,
not checkbox, and was eventually fixed in a daily...

--
Jeff Lane - Hardware Certification Engineer and Test Tools Developer
Ubuntu Ham: W4KDH
Freenode IRC: bladernr or bladernr_
gpg: 1024D/3A14B2DD 8C88 B076 0DD7 B404 1417 C466 4ABD 3635 3A14 B2DD

Ara Pulido (ara)
Changed in checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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