Bug 692632 - [PATCH] gettext: make 'Plural' parsing more robust
Summary: [PATCH] gettext: make 'Plural' parsing more robust
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Bohuslav "Slavek" Kabrda
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 692902
TreeView+ depends on / blocked
 
Reported: 2011-03-31 18:26 UTC by Matěj Cepl
Modified: 2018-04-11 13:11 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 692902 (view as bug list)
Environment:
Last Closed: 2013-07-31 19:17:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Make gettext plural parsing more robust (910 bytes, text/plain)
2011-04-01 15:56 UTC, Cole Robinson
no flags Details

Description Matěj Cepl 2011-03-31 18:26:57 UTC
Description of problem:
bradford:amazing-grace $ virt-manager 
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-manager.py", line 467, in <module>
    main()
  File "/usr/share/virt-manager/virt-manager.py", line 321, in main
    setup_i18n()
  File "/usr/share/virt-manager/virt-manager.py", line 80, in setup_i18n
    gettext.install(gettext_app, gettext_dir)
  File "/usr/lib64/python2.7/gettext.py", line 495, in install
    t = translation(domain, localedir, fallback=True, codeset=codeset)
  File "/usr/lib64/python2.7/gettext.py", line 480, in translation
    t = _translations.setdefault(key, class_(fp))
  File "/usr/lib64/python2.7/gettext.py", line 180, in __init__
    self._parse(fp)
  File "/usr/lib64/python2.7/gettext.py", line 316, in _parse
    plural = v[1].split('plural=')[1]
IndexError: list index out of range
bradford:amazing-grace $ locale 
LANG=cs_CZ.UTF-8
LC_CTYPE="cs_CZ.UTF-8"
LC_NUMERIC="cs_CZ.UTF-8"
LC_TIME="cs_CZ.UTF-8"
LC_COLLATE="cs_CZ.UTF-8"
LC_MONETARY="cs_CZ.UTF-8"
LC_MESSAGES="cs_CZ.UTF-8"
LC_PAPER="cs_CZ.UTF-8"
LC_NAME="cs_CZ.UTF-8"
LC_ADDRESS="cs_CZ.UTF-8"
LC_TELEPHONE="cs_CZ.UTF-8"
LC_MEASUREMENT="cs_CZ.UTF-8"
LC_IDENTIFICATION="cs_CZ.UTF-8"
LC_ALL=
bradford:amazing-grace $ 


Version-Release number of selected component (if applicable):
python-libs-2.7.1-6.fc15.x86_64

How reproducible:
100%

Steps to Reproduce:
1.just run virt-manager in non-English locale
2.
3.
  
Actual results:
backtrace and no virt-manager

Expected results:
virt-manager with Czech menus

Additional info:

Comment 1 Ignacio Vazquez-Abrams 2011-03-31 19:34:16 UTC
While Python *should* probably handle this more gracefully, this is actually a problem with po/cs.po in virt-manager. Reassigning.

Comment 2 Cole Robinson 2011-04-01 15:55:16 UTC
I've cloned this bug against virt-manager. Moving this one back to python.

Can you explain exactly what is wrong with cs.po that is causing this issue?
I'll get a fix into virt-manager as soon as possible.

IMO gettext should be extremely robust here, and any po format errors should
just result in translations being dropped with a warning message. Given that
translations are usually being done by people who aren't even testing the app,
a bogus translation file should never be able to DOS the app. Even for a
developer we shouldn't have to validate the app starts up with each locale.

Comment 3 Cole Robinson 2011-04-01 15:56:17 UTC
Created attachment 489427 [details]
Make gettext plural parsing more robust

Patch against rawhide python

Comment 4 Ignacio Vazquez-Abrams 2011-04-01 16:30:24 UTC
The exact issue is that the Plural-Forms header itself in po/cs.po is empty. A warning should probably be emitted, but we'll leave that for upstream to decide.

http://git.fedorahosted.org/git/?p=virt-manager.git;a=blob;f=po/cs.po;hb=HEAD

Comment 5 Fedora End Of Life 2012-08-07 16:09:04 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Cole Robinson 2012-10-15 02:40:02 UTC
This patch still applies to the F17 version. Dave, any chance this can be forwarded upstream? I still think the initial issue of a wonky translation file being able to hose an app is pretty serious, because

1) I doubt most devs test running their apps under every locale
2) transifex separates translators from actually using the app

Comment 7 Fedora Admin XMLRPC Client 2013-05-10 04:58:08 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 8 Fedora Admin XMLRPC Client 2013-05-10 04:59:58 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 9 Fedora Admin XMLRPC Client 2013-05-10 05:04:08 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 10 Fedora Admin XMLRPC Client 2013-05-10 05:12:08 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 11 Fedora Admin XMLRPC Client 2013-05-10 05:12:24 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 12 Matěj Cepl 2013-06-23 15:28:36 UTC
Why has this been WONTFIXed? Would a little bit of explanation be so difficult to utter?

Comment 13 Cole Robinson 2013-06-24 15:20:58 UTC
(In reply to Matěj Cepl from comment #12)
> Why has this been WONTFIXed? Would a little bit of explanation be so
> difficult to utter?

Sorry that was hasty of me. Bug had just been sitting in NEEDINFO for forever and limping along across releases and I didn't think anyone was even watching it besides me.

Comment 14 Fedora End Of Life 2013-07-03 20:02:31 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 15 Fedora End Of Life 2013-07-31 19:17:24 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


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