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.
Created on 2011年06月28日 07:38 by djc, last changed 2022年04月11日 14:57 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| issue12425.patch | akuchling, 2015年04月13日 15:08 | |||
| Messages (5) | |||
|---|---|---|---|
| msg139347 - (view) | Author: Dirkjan Ochtman (djc) * (Python committer) | Date: 2011年06月28日 07:38 | |
See https://bugzilla.redhat.com/show_bug.cgi?id=692632 for more details and a proposed patch. |
|||
| msg139435 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2011年06月29日 16:02 | |
IIUC, this comes up with invalid po files, so this report is about graceful error handling, not strictly a bug. If https://bugzilla.redhat.com/attachment.cgi?id=489427 was applied, gettext would not fail anymore, but the invalid line would not be reported IIUC. I think we should print an error message, to let libs/apps find the mistake. |
|||
| msg240618 - (view) | Author: A.M. Kuchling (akuchling) * (Python committer) | Date: 2015年04月13日 15:08 | |
Here's a patch against 3.5. This patch is atop the fix for #17898, so it won't apply cleanly to a stock 3.5. The patch uses warnings.warn() to issue a warning if the plural header is empty. There seems to be precedent for issuing warnings in the case of odd incoming data or behaviour, so I'm comfortable doing this; I think that warnings need not be only for Python language features, like deprecated things. But this does mean that importing gettext will also import warnings as a result, increasing memory usage. Probably this doesn't matter -- on any sizable program, you probably already have the warnings module imported. Otherwise we could print to sys.stderr. |
|||
| msg240679 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2015年04月13日 17:38 | |
LGTM |
|||
| msg302802 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2017年09月23日 19:56 | |
Sorry, I don't see a value of issuing warning if the following line of the code is failed. Why not raise an exception instead? A warning can be issued in the case of lacking nplurals= which is not used in Python implementation. I think additional checks should be added in msgfmt.py. GNU msgfmt checks that plural= and nplurals= are specified if there are plural form translations. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:19 | admin | set | github: 56634 |
| 2017年09月23日 19:56:11 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg302802 |
| 2015年04月13日 17:38:57 | ned.deily | set | nosy:
+ ned.deily messages: + msg240679 |
| 2015年04月13日 15:08:35 | akuchling | set | files:
+ issue12425.patch nosy: + akuchling messages: + msg240618 |
| 2013年05月31日 07:34:58 | bkabrda | set | nosy:
+ bkabrda |
| 2013年05月10日 19:07:51 | terry.reedy | set | versions: + Python 3.4, - Python 3.2 |
| 2011年06月29日 16:02:17 | eric.araujo | set | type: behavior versions: + Python 3.3, - Python 3.1 keywords: + patch, needs review nosy: + loewis, eric.araujo, lemburg messages: + msg139435 stage: patch review |
| 2011年06月28日 13:44:37 | Arfrever | set | nosy:
+ Arfrever |
| 2011年06月28日 07:38:27 | djc | create | |