homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: gettext breaks on plural-forms header
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: loewis Nosy List: Arfrever, akuchling, djc, dmalcolm, dsegan, eric.araujo, jwilk, loewis, orsenthil, potorange, ricky, syt
Priority: high Keywords: patch

Created on 2006年04月24日 13:09 by syt, last changed 2022年04月11日 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
gettext.py.patch syt, 2006年04月24日 13:11
plurals.diff loewis, 2006年07月17日 07:45 review
gettext.diff BreamoreBoy, 2010年07月15日 21:50 Fix AttributeError in Plural-Forms parsing
Messages (15)
msg50103 - (view) Author: Thenault Sylvain (syt) Date: 2006年04月24日 13:09
Here is a patch for the bug described in
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1448060&group_id=5470
It follows the latest Martin followup as I understand
it. I'm not sure if multi-lines field handling should
be totally discarded while reading metadata headers (as
implemented), or if it should only be discarded for the
content-type and plural-forms header. If one think this
patch isn't correct, please comment so I can fix it.
Notice that if the second solution was intended, lines
such as 
"#-#-#-#-# fr.po #-#-#-#-#\n"
inserted by msgcat/msgmerge will have to be treated
differently (i.e. multi-lines support but skip lines
begining with a #).
msg50104 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006年07月17日 07:45
Logged In: YES 
user_id=21627
The patch is wrong; it breaks the existing test case
WeirdMetadataTest. I think the "just a single line" rule
should be restricted to Plural-Forms; not sure whether it
should apply to content-type also (but why not).
I'll attach another patch that adds a test case.
msg50105 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006年08月25日 00:13
Logged In: YES 
user_id=21627
Couldn't get to it before 2.5; forwarding to 2.4.4/2.5.1
msg110389 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010年07月15日 21:50
Attached patch is my take on the fix to this, it's a two line change to gettext.py for 2.7. If the change is accepted I'll provide another patch for py3k. Nosy list updated while I'm at it.
msg110396 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010年07月15日 22:53
Sorry, forgot to say that the patched code passed all tests in the patched unit test file.
msg110413 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2010年07月16日 05:45
Minor change request. 
+class Bug1448060(GettextBaseTest):
Can you name the test class something more meaningful like PluralFormsTest or something like that. It is helpful when looking at it later. (Btw, this can be done by the committer during checkin too)
msg110429 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010年07月16日 12:15
Point taken I'll settle for PluralFormsTest unless there's a better idea. Assuming patch acceptance could a committer do this please?
msg116125 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010年09月11日 22:23
Could you follow the guidelines at http://www.python.org/dev/patches/ to create patches? Thanks in advance.
I wonder why you call tearDown from setUp. Doesn’t unittest do that for you when there is a failure in setUp? Also, you could use a with statement instead of try/finally.
msg139239 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2011年06月27日 07:29
This looks similar to https://bugs.gentoo.org/show_bug.cgi?id=373115. Is it the same thing, or should I file a separate bug for it? (Sorry, I don't intend to hijack this bug, but I don't know much about gettext and the patch here looks somewhat similar to the patch proposed there.)
msg139244 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011年06月27日 08:12
It's difficult to tell whether it's the same thing. Is the po file in question available readily for inspection?
msg139246 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2011年06月27日 08:31
Looks like this was the problem: http://git.fedorahosted.org/git/?p=virt-manager.git;a=commitdiff;h=cb56316cf3702f03b05e30f406ff3028e45f7bfb.
E.g., the empty Plural-Forms header is throwing off the python gettext parser.
msg139326 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011年06月27日 21:05
Ok. This is a different issue, then.
msg139348 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2011年06月28日 07:38
Okay, I've filed issue12425.
msg240633 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2015年04月13日 15:55
I think that #17898 is in fact a duplicate of this bug, due to old values of k and v confusing things. Mark's patch looks correct to me, but the patch in #17898 also adds a test. If that patch gets reviewed, I'll apply it to 3.4/3.5, and possibly to 2.7.
msg240895 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2015年04月14日 14:39
#17898 has been closed with basically the same fix as Mark's patch, so I'll close this issue.
History
Date User Action Args
2022年04月11日 14:56:17adminsetgithub: 43270
2015年04月14日 14:39:27akuchlingsetstatus: open -> closed
resolution: fixed
messages: + msg240895

stage: patch review -> resolved
2015年04月13日 15:55:44akuchlingsetnosy: + akuchling
messages: + msg240633
2013年06月14日 20:24:43jwilksetnosy: + jwilk
2013年05月10日 19:07:43terry.reedysetversions: + Python 3.4, - Python 3.2
2012年01月13日 17:20:12eric.araujosetdependencies: - Add tests for some scripts in Tools/scripts
2012年01月13日 17:19:58eric.araujosetdependencies: + Add tests for some scripts in Tools/scripts
2011年06月28日 07:38:54djcsetmessages: + msg139348
2011年06月27日 21:05:51loewissetmessages: + msg139326
2011年06月27日 09:35:49Arfreversetnosy: + Arfrever
2011年06月27日 08:31:59djcsetmessages: + msg139246
2011年06月27日 08:12:23loewissetmessages: + msg139244
2011年06月27日 07:29:51djcsetnosy: + djc
messages: + msg139239
2011年06月26日 18:58:37terry.reedysetversions: + Python 3.3, - Python 3.1
2011年05月14日 01:17:51rickysetnosy: + ricky
2010年11月21日 19:31:34eric.araujosetnosy: - BreamoreBoy
resolution: accepted -> (no value)
2010年09月11日 22:23:38eric.araujosetnosy: + eric.araujo
messages: + msg116125
2010年07月16日 12:15:22BreamoreBoysetmessages: + msg110429
2010年07月16日 05:45:52orsenthilsetnosy: + orsenthil
messages: + msg110413
2010年07月15日 22:53:26BreamoreBoysetmessages: + msg110396
2010年07月15日 21:50:23BreamoreBoysetfiles: + gettext.diff
versions: - Python 2.6
nosy: + dsegan, potorange, BreamoreBoy, - eric.araujo

messages: + msg110389
2010年07月15日 16:24:52eric.araujosetnosy: + eric.araujo
2010年07月15日 16:24:16eric.araujosettitle: patch fixing #1448060 (gettext.py bug) -> gettext breaks on plural-forms header
resolution: accepted
versions: + Python 2.7, Python 3.2
2010年07月15日 16:13:59eric.araujolinkissue1448060 superseder
2010年07月14日 13:35:19BreamoreBoyunlinkissue1448060 dependencies
2010年01月29日 19:29:04dmalcolmsetnosy: + dmalcolm
2009年03月21日 02:21:01ajaksu2setstage: patch review
type: behavior
versions: + Python 2.6, Python 3.1
2009年03月21日 02:20:00ajaksu2linkissue1448060 dependencies
2006年04月24日 13:09:38sytcreate

AltStyle によって変換されたページ (->オリジナル) /