DummyPOFile without language?

Bug #611179 reported by Jeroen T. Vermeulen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Jeroen T. Vermeulen

Bug Description

We just got an oops (just one, so probably something quite rare) that implies that a DummyPOFile has been created with its language set to None.

It looks as if the URL was bad and shouldn't have provided a page at all. It seems to be asking for the +imports page on a template, and according to the left-hand column of the oops report also adds +translate to the +imports URL.

OOPS-1670EC3710:
  AttributeError: 'NoneType' object has no attribute 'alt_suggestion_language'

Related branches

tags: added: oops
Changed in rosetta:
status: New → Triaged
importance: Undecided → High
Ursula Junque (ursinha)
description: updated
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

It just happened again: OOPS-1682EA2272. Note how the user (one of our colleagues) appears to be hacking the URL to get to en-US. No wonder there's no language on the POFile.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Now we have someone trying to load up +translate pages and getting oopses where they mis-spelled the language name (pt_br instead of pt_BR, an extra +translate instead of the language code).

We could fix this by checking for actual existence of the requested language somewhere near the point where we create a DummyPOFile, and raising a more appropriate "you're asking for something that doesn't exist" error. What's the point in serving up +translate pages without language after all?

   OOPS-1685N1103, OOPS-1685N1108
   OOPS-1685M1129, OOPS-1685N1104
   OOPS-1685L1067, OOPS-1685N1111
   OOPS-1685B1077

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

   OOPS-1686F14, OOPS-1686H27
   OOPS-1686F16, OOPS-1686N26
   OOPS-1686C18, OOPS-1686F15

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

And now it's someone else, trying to look at translations for nonexistent two-letter language codes:

   OOPS-1688M1568
   OOPS-1688C1398
   OOPS-1688H1334

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

POTemplateNavigation creates a DummyPOFile (if necessary) based on the result of getUtility(ILanguageSet).getLanguageByCode(...). But getLanguageByCode returns None if the code did not designate a known language, so we get a DummyPOFile without a language.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

   OOPS-1690F1289
   OOPS-1690G1398

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

   OOPS-1694C43
   OOPS-1694C215

Changed in rosetta:
status: Triaged → In Progress
assignee: nobody → Jeroen T. Vermeulen (jtv)
milestone: none → 10.09
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

   OOPS-1697N1064
   OOPS-1697F991
   OOPS-1697K1737

tags: added: qa-ok
Changed in rosetta:
status: In Progress → Fix Committed
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
tags: added: qa-needstesting
removed: qa-ok
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in rosetta:
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.