Bug 692632 - [PATCH] gettext: make 'Plural' parsing more robust
[PATCH] gettext: make 'Plural' parsing more robust
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Bohuslav "Slavek" Kabrda
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: 692902
  Show dependency treegraph
 
Reported: 2011-03-31 14:26 EDT by Matěj Cepl
Modified: 2013-07-31 15:17 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 692902 (view as bug list)
Environment:
Last Closed: 2013-07-31 15:17:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Matěj Cepl 2011-03-31 14:26:57 EDT
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 15:34:16 EDT
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 11:55:16 EDT
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 11:56:17 EDT
Created attachment 489427 [details]
Make gettext plural parsing more robust

Patch against rawhide python
Comment 4 Ignacio Vazquez-Abrams 2011-04-01 12:30:24 EDT
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 12:09:04 EDT
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-14 22:40:02 EDT
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 00:58:08 EDT
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 00:59:58 EDT
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 01:04:08 EDT
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 01:12:08 EDT
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 01:12:24 EDT
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 11:28:36 EDT
Why has this been WONTFIXed? Would a little bit of explanation be so difficult to utter?
Comment 13 Cole Robinson 2013-06-24 11:20:58 EDT
(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 16:02:31 EDT
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 15:17:24 EDT
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.