Report with po/*.mo file caused the exception and keep going. The
current failure is in po/tg.mo.
---
scripts/getlangnames.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/scripts/getlangnames.py b/scripts/getlangnames.py
index b81d26d..05b9805 100644
--- a/scripts/getlangnames.py
+++ b/scripts/getlangnames.py
@@ -32,7 +32,13 @@ for k in langs.localeInfo.keys():
f = open("po/%s.mo" %(l,))
except (OSError, IOError):
continue
- cat = gettext.GNUTranslations(f)
+
+ try:
+ cat = gettext.GNUTranslations(f)
+ except:
+ sys.stderr.write("*** ERROR reading po/%s.mo
" % (l,))
+ continue
+
cat.set_output_charset("utf-8")
names[langs.localeInfo[k][0]] = cat.lgettext(langs.localeInfo[k][0])
found = True
--
1.6.0.3
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
12-18-2008, 08:21 PM
Jeremy Katz
Catch exceptions from gettext.GNUTranslations
On Thu, 2008-12-18 at 11:16 -1000, David Cantrell wrote:
> Report with po/*.mo file caused the exception and keep going. The
> current failure is in po/tg.mo.
I'm pretty sure this will then lead to a runtime failure since we won't
have a native translation for the language name to show. Far better to
fail it at build time when it can be fixed.
I'll push a fixed po file (removing the plural-forms line since
apparently they don't use them for tg)
Jeremy
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
12-18-2008, 08:26 PM
David Cantrell
Catch exceptions from gettext.GNUTranslations
Jeremy Katz wrote:
> On Thu, 2008-12-18 at 11:16 -1000, David Cantrell wrote:
>> Report with po/*.mo file caused the exception and keep going. The
>> current failure is in po/tg.mo.
>
> I'm pretty sure this will then lead to a runtime failure since we won't
> have a native translation for the language name to show. Far better to
> fail it at build time when it can be fixed.
>
> I'll push a fixed po file (removing the plural-forms line since
> apparently they don't use them for tg)
Sounds good to me.
--
David Cantrell <dcantrell@redhat.com>
Red Hat / Honolulu, HI
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list